Windows CI: Setup for testing against Windows

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2016-01-08 11:43:59 -08:00
parent 1a7d40c692
commit a4b77dc1af
3 changed files with 36 additions and 6 deletions

View file

@ -30,7 +30,7 @@ fi
if ! docker inspect "${images[@]}" &> /dev/null; then
hardCodedDir='/docker-frozen-images'
if [ -d "$hardCodedDir" ]; then
# Do not use a subshell for the following command. Windows CI
# Do not use a subshell for the following command. Windows to Linux CI
# runs bash 3.x so will not trap an error in a subshell.
# http://stackoverflow.com/questions/22630363/how-does-set-e-work-with-subshells
set -x; tar -cC "$hardCodedDir" . | docker load; set +x
@ -55,7 +55,7 @@ if ! docker inspect "${images[@]}" &> /dev/null; then
}
}
' "${DOCKERFILE:=Dockerfile}" | sh -x
# Do not use a subshell for the following command. Windows CI
# Do not use a subshell for the following command. Windows to Linux CI
# runs bash 3.x so will not trap an error in a subshell.
# http://stackoverflow.com/questions/22630363/how-does-set-e-work-with-subshells
set -x; tar -cC "$dir" . | docker load; set +x

View file

@ -0,0 +1,25 @@
#!/bin/bash
set -e
# This scripts sets up the required images for Windows to Windows CI
# Tag windowsservercore as latest
set +e
! BUILD=$(docker images | grep windowsservercore | grep -v latest | awk '{print $2}')
if [ -z $BUILD ]; then
echo "ERROR: Could not find windowsservercore images"
exit 1
fi
! LATESTCOUNT=$(docker images | grep windowsservercore | grep -v $BUILD | wc -l)
if [ $LATESTCOUNT -ne 1 ]; then
set -e
docker tag windowsservercore:$BUILD windowsservercore:latest
echo "INFO: Tagged windowsservercore:$BUILD with latest"
fi
# Busybox (requires windowsservercore)
if [ -z "$(docker images | grep busybox)" ]; then
echo "INFO: Building busybox"
docker build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox/master/Dockerfile
fi

View file

@ -2,7 +2,12 @@
set -e
bundle .detect-daemon-osarch
bundle .ensure-emptyfs
bundle .ensure-frozen-images
bundle .ensure-httpserver
bundle .ensure-syscall-test
if [ $DOCKER_ENGINE_GOOS != "windows" ]; then
bundle .ensure-emptyfs
bundle .ensure-frozen-images
bundle .ensure-httpserver
bundle .ensure-syscall-test
else
# Note this is Windows to Windows CI, not Windows to Linux CI
bundle .ensure-frozen-images-windows
fi