Created
August 15, 2012 18:30
-
-
Save logicbomb/3362172 to your computer and use it in GitHub Desktop.
Example build system task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # the task file (backup-database-task.ps1) | |
| properties { | |
| $config = read-globalconfiguration($path) | |
| $source = $config.Environments[$sourceEnv] | |
| $dest = $config.Environments[$destEnv] | |
| } | |
| task default -depends exportDatabase | |
| task exportDatabase { | |
| write-host "exporting from: " $source.SqlDatabaseName | |
| write-host "to: " $dest.StorageAccountName | |
| } | |
| task ? -Description "Helper to display task info" { | |
| Write-Host "Backs up a Sql Database to BlobStorage" | |
| } | |
| # calling the task | |
| Invoke-psake .\backup-database-task.ps1 -parameters @{ "path"="..\global-configuration.xml"; "sourceEnv"="test"; "destEnv"="commit" } | |
| # output | |
| Executing exportDatabase | |
| exporting from: lemurtesting | |
| to: lemurcommit | |
| Build Succeeded! | |
| ---------------------------------------------------------------------- | |
| Build Time Report | |
| ---------------------------------------------------------------------- | |
| Name Duration | |
| ---- -------- | |
| exportDatabase 00:00:00.1435565 | |
| Total: 00:00:00.5048296 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment