-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
27 lines (22 loc) · 874 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
param(
[ValidateSet('Analyze','Build','Default','Deploy','Init','Test')]
[string]$Task = 'Default'
)
# adapted from Warren F's (ramblingcookiemonster) excellent PowerShell build/deploy utilties
# Grab nuget bits, install modules, set build variables, start build.
Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null
'InvokeBuild', 'BuildHelpers', 'Pester', 'PSScriptAnalyzer', 'PSDeploy' | ForEach-Object {
$ProgressPreference = 'SilentlyContinue'
if ($null -eq (Get-Module -Name $_ -ListAvailable)) { Install-Module -Name $_ -Force -AllowClobber }
Import-Module -Name $_ -Force
}
# delete build help environment variables if they already exist
Get-Item env:BH* | Remove-Item
# now re/set build environment variables
Set-BuildEnvironment
Invoke-Build -File .\InvokeBuild.ps1 -Task $Task -Result Result
if ($Result.Error) {
exit 1
} else {
exit 0
}