Skip to content

Commit 079cd80

Browse files
committed
Allow AppVeyor to download docker-compose
Also updates the base image to use latest, making it easier to keep heaths/vssetup:latest up-to-date with whatever AppVeyor lists as the base on https://www.appveyor.com/docs/build-environment/#pre-installed-software.
1 parent 9052f9f commit 079cd80

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT license. See LICENSE.txt in the project root for license information.
33

4-
FROM heaths/vssetup:1.11.2290
4+
FROM heaths/vssetup:latest
55
SHELL ["powershell.exe", "-ExecutionPolicy", "Bypass", "-Command"]
66

77
# Download and install Remote Debugger

docker/appveyor/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
# Would prefer to only use "image" in docker-compose.yml, but AppVeyor version of docker-compose fails
55
# stating that a "Dockerfile" in the current directory does not exist.
6-
FROM heaths/vssetup:1.11.2290
6+
FROM heaths/vssetup:latest

tools/test.ps1

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ param (
1313

1414
[Parameter()]
1515
[ValidateSet('Unit', 'Integration')]
16-
[string[]] $Type = @('Unit', 'Integration')
16+
[string[]] $Type = @('Unit', 'Integration'),
17+
18+
[Parameter()]
19+
[switch] $Download = $env:APPVEYOR -eq 'true'
1720
)
1821

1922
if (-not $Configuration) {
@@ -75,7 +78,13 @@ if ($Type -contains 'Unit')
7578
if ($Type -contains 'Integration')
7679
{
7780
# Run docker integration tests.
78-
if (get-command docker-compose -ea SilentlyContinue) {
81+
$cmd = (get-command docker-compose -ea SilentlyContinue).Path
82+
if (-not $cmd -and $Download) {
83+
invoke-webrequest 'https://github.com/docker/compose/releases/download/1.11.2/docker-compose-Windows-x86_64.exe' -outfile "${env:TEMP}\docker-compose.exe"
84+
$cmd = "${env:TEMP}\docker-compose.exe"
85+
}
86+
87+
if ($cmd) {
7988
[string] $path = if ($env:APPVEYOR -eq 'true') {
8089
$no_tty = '-T'
8190
resolve-path "$PSScriptRoot\..\docker\appveyor\docker-compose.yml"
@@ -88,7 +97,7 @@ if ($Type -contains 'Integration')
8897
}
8998

9099
write-verbose "Running tests in '$path'"
91-
docker-compose -f "$path" $verbose run $no_tty --rm test -c Invoke-Pester C:\Tests -EnableExit -OutputFile C:\Tests\Results.xml -OutputFormat NUnitXml
100+
& $cmd -f "$path" $verbose run $no_tty --rm test -c Invoke-Pester C:\Tests -EnableExit -OutputFile C:\Tests\Results.xml -OutputFormat NUnitXml
92101
if (-not $?) {
93102
$Failed = $true
94103
}
@@ -101,6 +110,8 @@ if ($Type -contains 'Integration')
101110
$wc = new-object System.Net.WebClient
102111
$wc.UploadFile($url, $path)
103112
}
113+
} else {
114+
write-warning 'Failed to find docker-compose; integration tests will not be performed.'
104115
}
105116

106117
if ($Failed) {

0 commit comments

Comments
 (0)