Skip to content

Instantly share code, notes, and snippets.

@swade1987
Last active August 29, 2015 14:20
Show Gist options
  • Save swade1987/b3f9922cb2c58784cbc3 to your computer and use it in GitHub Desktop.
Save swade1987/b3f9922cb2c58784cbc3 to your computer and use it in GitHub Desktop.
updated build script ...
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