Browse code

Check in latest Win2Lin Jenkins scripts

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

John Howard authored on 2016/02/19 04:58:56
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,35 @@
0
+set +x
1
+set +e 
2
+
3
+echo ""
4
+echo ""
5
+echo "---"
6
+echo "Now starting POST-BUILD steps"
7
+echo "---"
8
+echo ""
9
+
10
+echo INFO: Pointing to $DOCKER_HOST
11
+
12
+if [ ! $(docker ps -aq | wc -l) -eq 0 ]; then
13
+	echo INFO: Removing containers...
14
+	! docker rm -vf $(docker ps -aq)
15
+fi
16
+
17
+# Remove all images which don't have docker or ubuntu in the name
18
+if [ ! $(docker images | sed -n '1!p' | grep -v 'docker' | grep -v 'ubuntu' | awk '{ print $3 }' | wc -l) -eq 0 ]; then 
19
+	echo INFO: Removing images...
20
+	! docker rmi -f $(docker images | sed -n '1!p' | grep -v 'docker' | grep -v 'ubuntu' | awk '{ print $3 }') 
21
+fi
22
+
23
+# Kill off any instances of git, go and docker, just in case
24
+! taskkill -F -IM git.exe -T >& /dev/null
25
+! taskkill -F -IM go.exe -T >& /dev/null
26
+! taskkill -F -IM docker.exe -T >& /dev/null
27
+
28
+# Remove everything
29
+! cd /c/jenkins/gopath/src/github.com/docker/docker
30
+! rm -rfd * >& /dev/null
31
+! rm -rfd .* >& /dev/null
32
+
33
+echo INFO: Cleanup complete
34
+exit 0
0 35
\ No newline at end of file
... ...
@@ -1,7 +1,8 @@
1 1
 # Jenkins CI script for Windows to Linux CI.
2 2
 # Heavily modified by John Howard (@jhowardmsft) December 2015 to try to make it more reliable.
3 3
 set +x
4
-SCRIPT_VER="4-Jan-2016 15:19 PST"
4
+set +e
5
+SCRIPT_VER="18-Feb-2016 11:47 PST"
5 6
 
6 7
 # TODO to make (even) more resilient: 
7 8
 #  - Check if jq is installed
... ...
@@ -18,6 +19,7 @@ SCRIPT_VER="4-Jan-2016 15:19 PST"
18 18
 #  - Tidy up of images and containers. Either here, or in the teardown script.
19 19
 
20 20
 ec=0
21
+uniques=1
21 22
 echo INFO: Started at `date`. Script version $SCRIPT_VER
22 23
 
23 24
 # get the ip
... ...
@@ -212,22 +214,22 @@ fi
212 212
 GOVER_DOCKERFILE=`grep 'ENV GO_VERSION' Dockerfile | awk '{print $3}'`
213 213
 GOVER_INSTALLED=`go version | awk '{print $3}'`
214 214
 if [ "${GOVER_INSTALLED:2}" != "$GOVER_DOCKERFILE" ]; then
215
-	ec=1  # Uncomment to make CI fail once all nodes are updated.
215
+	#ec=1  # Uncomment to make CI fail once all nodes are updated.
216 216
 	echo
217 217
 	echo "---------------------------------------------------------------------------"
218
-	echo "ERROR: CI should be using go version $GOVER_DOCKERFILE, but is using ${GOVER_INSTALLED:2}"
219
-	echo "      This is currently a warning, but should (will) become an error in the future."
218
+	echo "WARN: CI should be using go version $GOVER_DOCKERFILE, but is using ${GOVER_INSTALLED:2}"
219
+	echo "      Please ping #docker-maintainers on IRC to get this CI server updated."
220 220
 	echo "---------------------------------------------------------------------------"
221 221
 	echo
222 222
 fi
223 223
 
224 224
 # Check the Linux box is running a matching version of docker
225 225
 if [ "$uniques" -ne 1 ]; then
226
-    ec=1  # Uncomment to make CI fail once all nodes are updated.
226
+    ec=0  # Uncomment to make CI fail once all nodes are updated.
227 227
 	echo
228 228
 	echo "---------------------------------------------------------------------------"
229 229
 	echo "ERROR: This CI node is not running the same version of docker as the daemon."
230
-	echo "       This is a CI configuration issue"
230
+	echo "       This is a CI configuration issue."
231 231
 	echo "---------------------------------------------------------------------------"
232 232
 	echo
233 233
 fi