-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpsakeBuild.ps1
More file actions
25 lines (21 loc) · 762 Bytes
/
psakeBuild.ps1
File metadata and controls
25 lines (21 loc) · 762 Bytes
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
properties {
$script = "$PSScriptRoot\src\"
}
task default -depends Analyze, Test
task Analyze {
$saResults = Invoke-ScriptAnalyzer -Path $script -Severity @('Error', 'Warning') -Recurse -Verbose:$false
if ($saResults) {
$saResults | Format-Table
Write-Error -Message 'One or more Script Analyzer errors/warnings where found. Build cannot continue!'
}
}
task Test {
$testResults = Invoke-Pester -Path $PSScriptRoot -PassThru
if ($testResults.FailedCount -gt 0) {
$testResults | Format-List
Write-Error -Message 'One or more Pester tests failed. Build cannot continue!'
}
}
task Deploy -depends Analyze, Test {
Invoke-PSDeploy -Path '.\deploy.ps1' -Force -Verbose:$VerbosePreference
}