-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.ps1
36 lines (31 loc) · 930 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
28
29
30
31
32
33
34
35
36
param(
[ValidateSet('Docker','Official')]
[string]$BuildType="Docker",
[switch]$Preview
)
$directory = 'stable'
if($Preview.IsPresent)
{
$directory='preview'
}
$fullDirectory = Join-Path -Path $psscriptroot -ChildPath $directory
Write-verbose -message "fd: $fullDirectory" -verbose
switch($BuildType)
{
'Docker' {
$command = "echo `$PWD && apt update && snapcraft --version && snapcraft clean -s build && snapcraft"
Write-verbose -message $command -verbose
docker run -v ${fullDirectory}:${fullDirectory} -w ${fullDirectory} 'snapcore/snapcraft:stable' sh -c $command
}
'Official' {
$name = 'powershell-snap-latest'
if($Preview.IsPresent)
{
$name = 'powershell-snap-preview-latest'
}
&"$PSScriptRoot/tools/releaseBuild/vstsbuild.ps1" -Name $Name
}
default {
throw "Unknown BuildType: $BuildType"
}
}