File tree Expand file tree Collapse file tree 2 files changed +24
-13
lines changed Expand file tree Collapse file tree 2 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 11version : 1.0.{build}
22image : Visual Studio 2017
33
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+
411build_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
912 - ps : .\test-build.ps1
Original file line number Diff line number Diff line change 11$ErrorActionPreference = ' Stop'
22
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+
319ForEach ($Dir in dir - directory | where { $_.Name -ne " docs" }) {
420 $tag = ((cat $Dir \windows\windowsservercore\Dockerfile | Select-String - Pattern ' ENV NODE_VERSION' ) -split ' ' )[2 ]
521
622 $variants = @ (' windowsservercore' , ' nanoserver' )
723 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
1725 }
1826}
You can’t perform that action at this time.
0 commit comments