Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre committed May 7, 2018
1 parent 5be2c47 commit 2b4b02d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
11 changes: 7 additions & 4 deletions appveyor.yml
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
26 changes: 17 additions & 9 deletions test-build.ps1
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
}
}

0 comments on commit 2b4b02d

Please sign in to comment.