Browse code

Windows CI: Setup for testing against Windows

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2016/01/09 04:43:59
Showing 3 changed files
... ...
@@ -30,7 +30,7 @@ fi
30 30
 if ! docker inspect "${images[@]}" &> /dev/null; then
31 31
 	hardCodedDir='/docker-frozen-images'
32 32
 	if [ -d "$hardCodedDir" ]; then
33
-		# Do not use a subshell for the following command. Windows CI
33
+		# Do not use a subshell for the following command. Windows to Linux CI
34 34
 		# runs bash 3.x so will not trap an error in a subshell.
35 35
 		# http://stackoverflow.com/questions/22630363/how-does-set-e-work-with-subshells
36 36
 		set -x; tar -cC "$hardCodedDir" . | docker load; set +x
... ...
@@ -55,7 +55,7 @@ if ! docker inspect "${images[@]}" &> /dev/null; then
55 55
 				}
56 56
 			}
57 57
 		' "${DOCKERFILE:=Dockerfile}" | sh -x
58
-		# Do not use a subshell for the following command. Windows CI
58
+		# Do not use a subshell for the following command. Windows to Linux CI
59 59
 		# runs bash 3.x so will not trap an error in a subshell.
60 60
 		# http://stackoverflow.com/questions/22630363/how-does-set-e-work-with-subshells
61 61
 		set -x; tar -cC "$dir" . | docker load; set +x
62 62
new file mode 100644
... ...
@@ -0,0 +1,25 @@
0
+#!/bin/bash
1
+set -e
2
+
3
+# This scripts sets up the required images for Windows to Windows CI
4
+
5
+# Tag windowsservercore as latest
6
+set +e
7
+! BUILD=$(docker images | grep windowsservercore | grep -v latest | awk '{print $2}')
8
+if [ -z $BUILD ]; then
9
+	echo "ERROR: Could not find windowsservercore images"
10
+	exit 1
11
+fi
12
+
13
+! LATESTCOUNT=$(docker images | grep windowsservercore | grep -v $BUILD | wc -l)
14
+if [ $LATESTCOUNT -ne 1 ]; then
15
+	set -e
16
+	docker tag windowsservercore:$BUILD windowsservercore:latest
17
+	echo "INFO: Tagged windowsservercore:$BUILD with latest"
18
+fi
19
+
20
+# Busybox (requires windowsservercore)
21
+if [ -z "$(docker images | grep busybox)" ]; then
22
+	echo "INFO: Building busybox"
23
+	docker build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox/master/Dockerfile
24
+fi
0 25
\ No newline at end of file
... ...
@@ -2,7 +2,12 @@
2 2
 set -e
3 3
 
4 4
 bundle .detect-daemon-osarch
5
-bundle .ensure-emptyfs
6
-bundle .ensure-frozen-images
7
-bundle .ensure-httpserver
8
-bundle .ensure-syscall-test
5
+if [ $DOCKER_ENGINE_GOOS != "windows" ]; then
6
+	bundle .ensure-emptyfs
7
+	bundle .ensure-frozen-images
8
+	bundle .ensure-httpserver
9
+	bundle .ensure-syscall-test
10
+else
11
+	# Note this is Windows to Windows CI, not Windows to Linux CI
12
+	bundle .ensure-frozen-images-windows
13
+fi