Last active
August 29, 2015 14:20
-
-
Save swade1987/b3f9922cb2c58784cbc3 to your computer and use it in GitHub Desktop.
updated build script ...
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
Param( | |
[string]$version | |
[string]$environment | |
) | |
properties{ | |
## General properties | |
## DevCI properties. | |
$environment_name = "DEV" | |
$specflow_base_url = "http://devci-url.com" | |
$web_server = "1.2.3.4" | |
$iis_website_name = "DEV" | |
$database_server = "1.2.3.4" | |
$database_name = "dev-db" | |
## QA properties. | |
$environment_name = "QA" | |
$specflow_base_url = "http://qa-url.com" | |
$web_server = "1.2.3.4" | |
$iis_website_name = "QA" | |
$database_server = "1.2.3.4" | |
$database_name = "qa-db" | |
## UAT properties | |
$environment_name = "UAT" | |
$specflow_base_url = "http://uat--url.com" | |
$web_server = "1.2.3.4" | |
$iis_website_name = "UAT" | |
$database_server = "1.2.3.4" | |
$database_name = "uat-db" | |
} | |
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition | |
$psake_module_dir = "$($scriptPath)\..\packages\psake.4.4.1\tools\psake.psm1" | |
## Import psake module | |
Import-Module $psake_module_dir; | |
## Run the necessary build with the necessary parameters | |
if($environment = "DevCI") | |
{ | |
Invoke-psake "$($scriptPath)\default.ps1" -t "build_release_and_specflow_test" -parameters @{"version"=$version} | |
if ($psake.build_success -eq $false) { exit 1 } else { exit 0 } | |
} | |
elseif($environment = "QA") | |
{ | |
Invoke-psake "$($scriptPath)\default.ps1" -t "build_release_and_specflow_test" -parameters @{"version"=$version} | |
if ($psake.build_success -eq $false) { exit 1 } else { exit 0 } | |
} | |
elseif($environment = "UAT") | |
{ | |
Invoke-psake "$($scriptPath)\default.ps1" -t "build_and_release_only" -parameters @{"version"=$version} | |
if ($psake.build_success -eq $false) { exit 1 } else { exit 0 } | |
} | |
else | |
{ | |
throw $environment not recognised! | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment