1- # The creation of this build script (and associated files) was only possible using the
2- # work that was done on the BoxStarter Project on GitHub:
3- # http://boxstarter.codeplex.com/
4- # Big thanks to Matt Wrock (@mwrockx} for creating this project, thanks!
5-
6- param (
7- [string ]$Action = " default" ,
8- [string ]$Config = " Debug" ,
9- [switch ]$Help
10- )
11-
12- $here = " $ ( Split-Path - parent $MyInvocation.MyCommand.Definition ) "
13- $psakePath = Join-Path $here - Child " ..\Tools\psake\psake.psm1" ;
14- Import-Module $psakePath ;
15-
16- if ($Help ){
17- try {
18- Get-Help " $ ( $MyInvocation.MyCommand.Definition ) " - full | Out-Host - paging
19- Write-Output " Available build tasks:"
20- invoke-psake " $here /default.ps1" - nologo - docs | Out-Host - paging
21- } catch {}
22-
23- return
24- }
25-
1+ # The creation of this build script (and associated files) was only possible using the
2+ # work that was done on the BoxStarter Project on GitHub:
3+ # http://boxstarter.codeplex.com/
4+ # Big thanks to Matt Wrock (@mwrockx} for creating this project, thanks!
5+
6+ param (
7+ [string ]$Action = " default" ,
8+ [string ]$Config = " Debug" ,
9+ [switch ]$Help
10+ )
11+
12+ $here = " $ ( Split-Path - parent $MyInvocation.MyCommand.Definition ) "
13+ $psakePath = Join-Path $here - Child " ..\Tools\psake\psake.psm1" ;
14+ Import-Module $psakePath ;
15+
16+ if ($Help ){
17+ try {
18+ Get-Help " $ ( $MyInvocation.MyCommand.Definition ) " - full | Out-Host - paging
19+ Write-Output " Available build tasks:"
20+ invoke-psake " $here /default.ps1" - nologo - docs | Out-Host - paging
21+ } catch {}
22+
23+ return
24+ }
25+
2626if (Test-Path - Path env:\APPVEYOR) {
2727 if ($env: APPVEYOR_SCHEDULED_BUILD -eq " True" ) {
2828 Write-Output " Since this is a scheduled build, simply run a build, with deployment of Coverity Artifacts, but no other deployment"
2929 invoke-psake " $here /default.ps1" - task RebuildSolution - properties @ { ' config' = ' Release' ; }
30- } elseif ($env: APPVEYOR_REPO_BRANCH -eq " develop" -And $env: APPVEYOR_PULL_REQUEST_NUMBER -eq $null ) {
31- Write-Output " Since we are on develop branch with no pull request number, we are ready to deploy to Develop MyGet Feed"
32- invoke-psake " $here /default.ps1" - task DeployDevelopSolutionToMyGet - properties @ { ' config' = ' Release' ; }
33- } elseif ($env: APPVEYOR_REPO_BRANCH -eq " develop" -And $env: APPVEYOR_PULL_REQUEST_NUMBER -ne $null ) {
34- Write-Output " Since we are on develop branch with a pull request number, we are just going to package the solution, with no deployment"
35- invoke-psake " $here /default.ps1" - task InspectCodeForProblems - properties @ { ' config' = ' Release' ; }
36- } elseif ($env: APPVEYOR_REPO_BRANCH -eq " master" -And $env: APPVEYOR_PULL_REQUEST_NUMBER -eq $null -And $env: APPVEYOR_REPO_TAG -eq $false ) {
37- Write-Output " Since we are on master branch with no pull request number, and no tag applied, we are ready to deploy to Master MyGet Feed"
38- invoke-psake " $here /default.ps1" - task DeployMasterSolutionToMyGet - properties @ { ' config' = ' Release' ; }
39- } elseif ($env: APPVEYOR_REPO_BRANCH -eq " master" -And $env: APPVEYOR_PULL_REQUEST_NUMBER -ne $null -And $env: APPVEYOR_REPO_TAG -eq $false ) {
40- Write-Output " Since we are on master branch with a pull request number, and no tag applied, we are just going to package the solution, with no deployment"
41- invoke-psake " $here /default.ps1" - task InspectCodeForProblems - properties @ { ' config' = ' Release' ; }
42- } elseif ($env: APPVEYOR_REPO_BRANCH -eq " master" -And $env: APPVEYOR_PULL_REQUEST_NUMBER -eq $null -And $env: APPVEYOR_REPO_TAG -eq $true ) {
43- Write-Output " Since we are on master branch with no pull request number, and a tag has been applied, we are ready to deploy Chocolatey.org"
44- invoke-psake " $here /default.ps1" - task DeploySolutionToChocolatey - properties @ { ' config' = ' Release' ; }
45- }
46- } else {
47- invoke-psake " $here /default.ps1" - task $Action - properties @ { ' config' = $Config ; }
48- }
49-
50- # If for some reason, the above if statement doesn't actually invoke-psake, the $psake.build_success will be false
51- # so it will exit with a code of 1 below, which will fail the build.
52- if ($psake.build_success -eq $false ) {
53- exit 1
54- } else {
55- exit 0
30+ } elseif ($env: APPVEYOR_REPO_BRANCH -eq " develop" -And $env: APPVEYOR_PULL_REQUEST_NUMBER -eq $null ) {
31+ Write-Output " Since we are on develop branch with no pull request number, we are ready to deploy to Develop MyGet Feed"
32+ invoke-psake " $here /default.ps1" - task DeployDevelopSolutionToMyGet - properties @ { ' config' = ' Release' ; }
33+ } elseif ($env: APPVEYOR_REPO_BRANCH -eq " develop" -And $env: APPVEYOR_PULL_REQUEST_NUMBER -ne $null ) {
34+ Write-Output " Since we are on develop branch with a pull request number, we are just going to package the solution, with no deployment"
35+ invoke-psake " $here /default.ps1" - task InspectCodeForProblems - properties @ { ' config' = ' Release' ; }
36+ } elseif ($env: APPVEYOR_REPO_BRANCH -eq " master" -And $env: APPVEYOR_PULL_REQUEST_NUMBER -eq $null -And $env: APPVEYOR_REPO_TAG -eq $false ) {
37+ Write-Output " Since we are on master branch with no pull request number, and no tag applied, we are ready to deploy to Master MyGet Feed"
38+ invoke-psake " $here /default.ps1" - task DeployMasterSolutionToMyGet - properties @ { ' config' = ' Release' ; }
39+ } elseif ($env: APPVEYOR_REPO_BRANCH -eq " master" -And $env: APPVEYOR_PULL_REQUEST_NUMBER -ne $null -And $env: APPVEYOR_REPO_TAG -eq $false ) {
40+ Write-Output " Since we are on master branch with a pull request number, and no tag applied, we are just going to package the solution, with no deployment"
41+ invoke-psake " $here /default.ps1" - task InspectCodeForProblems - properties @ { ' config' = ' Release' ; }
42+ } elseif ($env: APPVEYOR_REPO_BRANCH -eq " master" -And $env: APPVEYOR_PULL_REQUEST_NUMBER -eq $null -And $env: APPVEYOR_REPO_TAG -eq $true ) {
43+ Write-Output " Since we are on master branch with no pull request number, and a tag has been applied, we are ready to deploy Chocolatey.org"
44+ invoke-psake " $here /default.ps1" - task DeploySolutionToChocolatey - properties @ { ' config' = ' Release' ; }
45+ }
46+ } else {
47+ invoke-psake " $here /default.ps1" - task $Action - properties @ { ' config' = $Config ; }
48+ }
49+
50+ # If for some reason, the above if statement doesn't actually invoke-psake, the $psake.build_success will be false
51+ # so it will exit with a code of 1 below, which will fail the build.
52+ if ($psake.build_success -eq $false ) {
53+ exit 1
54+ } else {
55+ exit 0
5656}
0 commit comments