-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5be2c47
commit 2b4b02d
Showing
2 changed files
with
24 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
version: 1.0.{build} | ||
image: Visual Studio 2017 | ||
|
||
install: | ||
- ps: Install-PackageProvider -Name NuGet -Force | ||
- ps: Install-Module PsScriptAnalyzer -Force | ||
|
||
before_build: | ||
-ps: Invoke-ScriptAnalyzer -Path '*.ps1' | ||
|
||
build_script: | ||
- ps: Install-Package -Name docker -ProviderName DockerMsftProvider -RequiredVersion 17.06.1-ee-1-rc1 -Force | ||
- ps: start-service docker | ||
- docker pull microsoft/windowsservercore | ||
- docker pull microsoft/nanoserver | ||
- ps: .\test-build.ps1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
$ErrorActionPreference = 'Stop' | ||
|
||
function Build { | ||
param ( $version, $variant, $tag ) | ||
|
||
$path = "" | ||
|
||
Write-Host Building node:$tag-$variant | ||
docker build -t node:$tag-$variant $version/windows/$variant | ||
|
||
$OUTPUT=$(docker run --rm node:$tag-$variant node -e "process.stdout.write(process.versions.node)") | ||
if ( "$OUTPUT" -Ne "$tag" ) { | ||
Write-Error "Test of $tag-$variant failed!" | ||
} else { | ||
Write-Host "Test of $tag-$variant succeeded." | ||
} | ||
} | ||
|
||
ForEach ($Dir in dir -directory | where { $_.Name -ne "docs" }) { | ||
$tag = ((cat $Dir\windows\windowsservercore\Dockerfile | Select-String -Pattern 'ENV NODE_VERSION') -split ' ')[2] | ||
|
||
$variants = @('windowsservercore', 'nanoserver') | ||
ForEach ($variant in $variants) { | ||
Write-Host Building node:$tag-$variant | ||
docker build -t node:$tag-$variant $Dir/windows/$variant | ||
|
||
$OUTPUT=$(docker run --rm node:$tag-$variant node -e "process.stdout.write(process.versions.node)") | ||
if ( "$OUTPUT" -Ne "$tag" ) { | ||
Write-Error "Test of $tag-$variant failed!" | ||
} else { | ||
Write-Host "Test of $tag-$variant succeeded." | ||
} | ||
Build $Dir $variant $tag | ||
} | ||
} |