Merge pull request #9 from StefanScherer/migrate-matrix-to-appveyor
Migrate Linux builds to AppVeyorpull/10/head 1.7.0
commit
3985d8c5d9
@ -1,9 +0,0 @@
|
|||||||
version: 2
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
working_directory: ~/whoami
|
|
||||||
machine: true
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run: ARCH=arm ./travis-build.sh
|
|
||||||
- run: ARCH=arm ./travis-test.sh
|
|
@ -1,20 +0,0 @@
|
|||||||
sudo: required
|
|
||||||
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
env:
|
|
||||||
matrix:
|
|
||||||
- ARCH=arm
|
|
||||||
- ARCH=arm64
|
|
||||||
- ARCH=amd64
|
|
||||||
|
|
||||||
script:
|
|
||||||
- ./travis-build.sh
|
|
||||||
- ./travis-test.sh
|
|
||||||
- >
|
|
||||||
if [ -n "$TRAVIS_TAG" ]; then
|
|
||||||
# push image
|
|
||||||
travis_retry timeout 5m echo "$DOCKER_PASS" | docker login -u="$DOCKER_USER" --password-stdin
|
|
||||||
./travis-deploy.sh
|
|
||||||
fi
|
|
@ -1,7 +0,0 @@
|
|||||||
$ErrorActionPreference = 'Stop';
|
|
||||||
$files = ""
|
|
||||||
Write-Host Starting build
|
|
||||||
|
|
||||||
docker build --pull -t whoami -f Dockerfile.windows .
|
|
||||||
|
|
||||||
docker images
|
|
@ -1,27 +0,0 @@
|
|||||||
$ErrorActionPreference = 'Stop';
|
|
||||||
|
|
||||||
if (! (Test-Path Env:\APPVEYOR_REPO_TAG_NAME)) {
|
|
||||||
Write-Host "No version tag detected. Skip publishing."
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host Starting deploy
|
|
||||||
docker login -u="$env:DOCKER_USER" -p="$env:DOCKER_PASS"
|
|
||||||
|
|
||||||
docker tag whoami stefanscherer/whoami:windows-amd64-$env:APPVEYOR_REPO_TAG_NAME
|
|
||||||
|
|
||||||
docker push stefanscherer/whoami:windows-amd64-$env:APPVEYOR_REPO_TAG_NAME
|
|
||||||
|
|
||||||
Write-Host Rebasing image to produce 1709 variant
|
|
||||||
npm install -g rebase-docker-image
|
|
||||||
rebase-docker-image `
|
|
||||||
stefanscherer/whoami:windows-amd64-$env:APPVEYOR_REPO_TAG_NAME `
|
|
||||||
-t stefanscherer/whoami:windows-amd64-$env:APPVEYOR_REPO_TAG_NAME-1709 `
|
|
||||||
-b microsoft/nanoserver:1709
|
|
||||||
|
|
||||||
Write-Host Rebasing image to produce 1803 variant
|
|
||||||
npm install -g rebase-docker-image
|
|
||||||
rebase-docker-image `
|
|
||||||
stefanscherer/whoami:windows-amd64-$env:APPVEYOR_REPO_TAG_NAME `
|
|
||||||
-t stefanscherer/whoami:windows-amd64-$env:APPVEYOR_REPO_TAG_NAME-1803 `
|
|
||||||
-b microsoft/nanoserver:1803
|
|
@ -1,18 +1,26 @@
|
|||||||
version: 1.0.{build}
|
version: 1.0.{build}
|
||||||
image: Visual Studio 2017
|
image:
|
||||||
|
- Visual Studio 2017
|
||||||
|
- Ubuntu
|
||||||
|
|
||||||
|
environment:
|
||||||
|
matrix:
|
||||||
|
- ARCH: arm
|
||||||
|
- ARCH: arm64
|
||||||
|
- ARCH: amd64
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
exclude:
|
||||||
|
- image: Visual Studio 2017
|
||||||
|
ARCH: arm
|
||||||
|
- image: Visual Studio 2017
|
||||||
|
ARCH: arm64
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- ps: .\appveyor-build.ps1
|
- ps: ./build.ps1
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- ps: .\appveyor-test.ps1
|
- ps: ./test.ps1
|
||||||
|
|
||||||
deploy_script:
|
deploy_script:
|
||||||
- ps: >-
|
- ps: ./deploy.ps1
|
||||||
if (Test-Path Env:\APPVEYOR_REPO_TAG_NAME) {
|
|
||||||
|
|
||||||
docker login -u="$env:DOCKER_USER" -p="$env:DOCKER_PASS"
|
|
||||||
|
|
||||||
.\appveyor-deploy.ps1
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
$ErrorActionPreference = 'Stop';
|
||||||
|
$files = ""
|
||||||
|
Write-Host Starting build
|
||||||
|
|
||||||
|
if ($isWindows) {
|
||||||
|
docker build --pull -t whoami -f Dockerfile.windows .
|
||||||
|
} else {
|
||||||
|
docker build -t whoami --build-arg "arch=$env:ARCH" .
|
||||||
|
}
|
||||||
|
|
||||||
|
docker images
|
@ -0,0 +1,62 @@
|
|||||||
|
$ErrorActionPreference = 'Stop';
|
||||||
|
|
||||||
|
if (! (Test-Path Env:\APPVEYOR_REPO_TAG_NAME)) {
|
||||||
|
Write-Host "No version tag detected. Skip publishing."
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
$image = "stefanscherer/whoami"
|
||||||
|
|
||||||
|
Write-Host Starting deploy
|
||||||
|
if (!(Test-Path ~/.docker)) { mkdir ~/.docker }
|
||||||
|
'{ "experimental": "enabled" }' | Out-File ~/.docker/config.json -Encoding Ascii
|
||||||
|
docker login -u="$env:DOCKER_USER" -p="$env:DOCKER_PASS"
|
||||||
|
|
||||||
|
$os = If ($isWindows) {"windows"} Else {"linux"}
|
||||||
|
docker tag whoami "$($image):$os-$env:ARCH-$env:APPVEYOR_REPO_TAG_NAME"
|
||||||
|
docker push "$($image):$os-$env:ARCH-$env:APPVEYOR_REPO_TAG_NAME"
|
||||||
|
|
||||||
|
if ($isWindows) {
|
||||||
|
# Windows
|
||||||
|
Write-Host "Rebasing image to produce 1709 variant"
|
||||||
|
npm install -g rebase-docker-image
|
||||||
|
rebase-docker-image `
|
||||||
|
"$($image):$os-$env:ARCH-$env:APPVEYOR_REPO_TAG_NAME" `
|
||||||
|
-t "$($image):$os-$env:ARCH-$env:APPVEYOR_REPO_TAG_NAME-1709" `
|
||||||
|
-b microsoft/nanoserver:1709
|
||||||
|
|
||||||
|
Write-Host "Rebasing image to produce 1803 variant"
|
||||||
|
npm install -g rebase-docker-image
|
||||||
|
rebase-docker-image `
|
||||||
|
"$($image):$os-$env:ARCH-$env:APPVEYOR_REPO_TAG_NAME" `
|
||||||
|
-t "$($image):$os-$env:ARCH-$env:APPVEYOR_REPO_TAG_NAME-1803" `
|
||||||
|
-b microsoft/nanoserver:1803
|
||||||
|
|
||||||
|
} else {
|
||||||
|
# Linux
|
||||||
|
if ($env:ARCH -eq "amd64") {
|
||||||
|
# The last in the build matrix
|
||||||
|
docker -D manifest create "$($image):$env:APPVEYOR_REPO_TAG_NAME" `
|
||||||
|
"$($image):linux-amd64-$env:APPVEYOR_REPO_TAG_NAME" `
|
||||||
|
"$($image):linux-arm-$env:APPVEYOR_REPO_TAG_NAME" `
|
||||||
|
"$($image):linux-arm64-$env:APPVEYOR_REPO_TAG_NAME" `
|
||||||
|
"$($image):windows-amd64-$env:APPVEYOR_REPO_TAG_NAME" `
|
||||||
|
"$($image):windows-amd64-$env:APPVEYOR_REPO_TAG_NAME-1709" `
|
||||||
|
"$($image):windows-amd64-$env:APPVEYOR_REPO_TAG_NAME-1803"
|
||||||
|
docker manifest annotate "$($image):$env:APPVEYOR_REPO_TAG_NAME" "$($image):linux-arm-$env:APPVEYOR_REPO_TAG_NAME" --os linux --arch arm --variant v6
|
||||||
|
docker manifest annotate "$($image):$env:APPVEYOR_REPO_TAG_NAME" "$($image):linux-arm64-$env:APPVEYOR_REPO_TAG_NAME" --os linux --arch arm64 --variant v8
|
||||||
|
docker manifest push "$($image):$env:APPVEYOR_REPO_TAG_NAME"
|
||||||
|
|
||||||
|
Write-Host "Pushing manifest $($image):latest"
|
||||||
|
docker -D manifest create "$($image):latest" `
|
||||||
|
"$($image):linux-amd64-$env:APPVEYOR_REPO_TAG_NAME" `
|
||||||
|
"$($image):linux-arm-$env:APPVEYOR_REPO_TAG_NAME" `
|
||||||
|
"$($image):linux-arm64-$env:APPVEYOR_REPO_TAG_NAME" `
|
||||||
|
"$($image):windows-amd64-$env:APPVEYOR_REPO_TAG_NAME" `
|
||||||
|
"$($image):windows-amd64-$env:APPVEYOR_REPO_TAG_NAME-1709" `
|
||||||
|
"$($image):windows-amd64-$env:APPVEYOR_REPO_TAG_NAME-1803"
|
||||||
|
docker manifest annotate "$($image):latest" "$($image):linux-arm-$env:APPVEYOR_REPO_TAG_NAME" --os linux --arch arm --variant v6
|
||||||
|
docker manifest annotate "$($image):latest" "$($image):linux-arm64-$env:APPVEYOR_REPO_TAG_NAME" --os linux --arch arm64 --variant v8
|
||||||
|
docker manifest push "$($image):latest"
|
||||||
|
}
|
||||||
|
}
|
Before Width: | Height: | Size: 216 KiB After Width: | Height: | Size: 181 KiB |
@ -1,5 +1,10 @@
|
|||||||
Write-Host Starting test
|
Write-Host Starting test
|
||||||
|
|
||||||
|
if ($env:ARCH -ne "amd64") {
|
||||||
|
Write-Host "Arch $env:ARCH detected. Skip testing."
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
$ErrorActionPreference = 'SilentlyContinue';
|
$ErrorActionPreference = 'SilentlyContinue';
|
||||||
docker kill whoamitest
|
docker kill whoamitest
|
||||||
docker rm -f whoamitest
|
docker rm -f whoamitest
|
@ -1,22 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
docker version
|
|
||||||
uname -a
|
|
||||||
|
|
||||||
echo "Updating Docker engine to have multi-stage builds and manifest command"
|
|
||||||
sudo service docker stop
|
|
||||||
curl -fsSL https://get.docker.com/ | sudo sh
|
|
||||||
|
|
||||||
echo "Enabling docker client experimental features"
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo '{ "experimental": "enabled" }' > ~/.docker/config.json
|
|
||||||
|
|
||||||
docker version
|
|
||||||
|
|
||||||
if [ -d tmp ]; then
|
|
||||||
docker rm build
|
|
||||||
rm -rf tmp
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker build -t whoami --build-arg "arch=$ARCH" .
|
|
@ -1,61 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
image="stefanscherer/whoami"
|
|
||||||
docker tag whoami "$image:linux-$ARCH-$TRAVIS_TAG"
|
|
||||||
docker push "$image:linux-$ARCH-$TRAVIS_TAG"
|
|
||||||
|
|
||||||
if [ "$ARCH" == "amd64" ]; then
|
|
||||||
set +e
|
|
||||||
echo "Waiting for other images $image:linux-arm-$TRAVIS_TAG"
|
|
||||||
until docker run --rm stefanscherer/winspector "$image:linux-arm-$TRAVIS_TAG"
|
|
||||||
do
|
|
||||||
sleep 15
|
|
||||||
echo "Try again"
|
|
||||||
done
|
|
||||||
until docker run --rm stefanscherer/winspector "$image:linux-arm64-$TRAVIS_TAG"
|
|
||||||
do
|
|
||||||
sleep 15
|
|
||||||
echo "Try again"
|
|
||||||
done
|
|
||||||
until docker run --rm stefanscherer/winspector "$image:windows-amd64-$TRAVIS_TAG"
|
|
||||||
do
|
|
||||||
sleep 15
|
|
||||||
echo "Try again"
|
|
||||||
done
|
|
||||||
until docker run --rm stefanscherer/winspector "$image:windows-amd64-$TRAVIS_TAG-1709"
|
|
||||||
do
|
|
||||||
sleep 15
|
|
||||||
echo "Try again"
|
|
||||||
done
|
|
||||||
until docker run --rm stefanscherer/winspector "$image:windows-amd64-$TRAVIS_TAG-1803"
|
|
||||||
do
|
|
||||||
sleep 15
|
|
||||||
echo "Try again"
|
|
||||||
done
|
|
||||||
set -e
|
|
||||||
|
|
||||||
echo "Pushing manifest $image:$TRAVIS_TAG"
|
|
||||||
docker -D manifest create "$image:$TRAVIS_TAG" \
|
|
||||||
"$image:linux-amd64-$TRAVIS_TAG" \
|
|
||||||
"$image:linux-arm-$TRAVIS_TAG" \
|
|
||||||
"$image:linux-arm64-$TRAVIS_TAG" \
|
|
||||||
"$image:windows-amd64-$TRAVIS_TAG" \
|
|
||||||
"$image:windows-amd64-$TRAVIS_TAG-1709" \
|
|
||||||
"$image:windows-amd64-$TRAVIS_TAG-1803"
|
|
||||||
docker manifest annotate "$image:$TRAVIS_TAG" "$image:linux-arm-$TRAVIS_TAG" --os linux --arch arm --variant v6
|
|
||||||
docker manifest annotate "$image:$TRAVIS_TAG" "$image:linux-arm64-$TRAVIS_TAG" --os linux --arch arm64 --variant v8
|
|
||||||
docker manifest push "$image:$TRAVIS_TAG"
|
|
||||||
|
|
||||||
echo "Pushing manifest $image:latest"
|
|
||||||
docker -D manifest create "$image:latest" \
|
|
||||||
"$image:linux-amd64-$TRAVIS_TAG" \
|
|
||||||
"$image:linux-arm-$TRAVIS_TAG" \
|
|
||||||
"$image:linux-arm64-$TRAVIS_TAG" \
|
|
||||||
"$image:windows-amd64-$TRAVIS_TAG" \
|
|
||||||
"$image:windows-amd64-$TRAVIS_TAG-1709" \
|
|
||||||
"$image:windows-amd64-$TRAVIS_TAG-1803"
|
|
||||||
docker manifest annotate "$image:latest" "$image:linux-arm-$TRAVIS_TAG" --os linux --arch arm --variant v6
|
|
||||||
docker manifest annotate "$image:latest" "$image:linux-arm64-$TRAVIS_TAG" --os linux --arch arm64 --variant v8
|
|
||||||
docker manifest push "$image:latest"
|
|
||||||
fi
|
|
@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ "$ARCH" == "amd64" ]; then
|
|
||||||
# test image
|
|
||||||
docker run -d -p 8080:8080 --name=whoamitest whoami
|
|
||||||
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
docker logs whoamitest
|
|
||||||
fi
|
|
Loading…
Reference in new issue