File tree 2 files changed +24
-13
lines changed
2 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 1
1
version : 1.0.{build}
2
2
image : Visual Studio 2017
3
3
4
+ install :
5
+ - ps : Install-PackageProvider -Name NuGet -Force
6
+ - ps : Install-Module PsScriptAnalyzer -Force
7
+
8
+ before_build :
9
+ -ps : Invoke-ScriptAnalyzer -Path '*.ps1'
10
+
4
11
build_script :
5
- - ps : Install-Package -Name docker -ProviderName DockerMsftProvider -RequiredVersion 17.06.1-ee-1-rc1 -Force
6
- - ps : start-service docker
7
- - docker pull microsoft/windowsservercore
8
- - docker pull microsoft/nanoserver
9
12
- ps : .\test-build.ps1
Original file line number Diff line number Diff line change 1
1
$ErrorActionPreference = ' Stop'
2
2
3
+ function Build {
4
+ param ( $version , $variant , $tag )
5
+
6
+ $path = " "
7
+
8
+ Write-Host Building node:$tag - $variant
9
+ docker build - t node:$tag - $variant $version / windows/ $variant
10
+
11
+ $OUTPUT = $ (docker run -- rm node:$tag - $variant node - e " process.stdout.write(process.versions.node)" )
12
+ if ( " $OUTPUT " -Ne " $tag " ) {
13
+ Write-Error " Test of $tag -$variant failed!"
14
+ } else {
15
+ Write-Host " Test of $tag -$variant succeeded."
16
+ }
17
+ }
18
+
3
19
ForEach ($Dir in dir - directory | where { $_.Name -ne " docs" }) {
4
20
$tag = ((cat $Dir \windows\windowsservercore\Dockerfile | Select-String - Pattern ' ENV NODE_VERSION' ) -split ' ' )[2 ]
5
21
6
22
$variants = @ (' windowsservercore' , ' nanoserver' )
7
23
ForEach ($variant in $variants ) {
8
- Write-Host Building node:$tag - $variant
9
- docker build - t node:$tag - $variant $Dir / windows/ $variant
10
-
11
- $OUTPUT = $ (docker run -- rm node:$tag - $variant node - e " process.stdout.write(process.versions.node)" )
12
- if ( " $OUTPUT " -Ne " $tag " ) {
13
- Write-Error " Test of $tag -$variant failed!"
14
- } else {
15
- Write-Host " Test of $tag -$variant succeeded."
16
- }
24
+ Build $Dir $variant $tag
17
25
}
18
26
}
You can’t perform that action at this time.
0 commit comments