Make use of the realclean build.sh feature to build the docker images.
[arvados.git] / jenkins / run-docker-tests.sh
1 #!/bin/bash
2
3 EXITCODE=0
4
5 COLUMNS=80
6
7 title () {
8   printf "\n%*s\n\n" $(((${#title}+$COLUMNS)/2)) "********** $1 **********"
9 }
10
11 echo $WORKSPACE
12
13 # DOCKER
14 title "Starting docker build"
15
16 # clean up existing docker containers and images
17 docker.io stop $(docker.io ps -a -q)
18 docker.io rm $(docker.io ps -a -q)
19 docker.io rmi $(docker.io images -q)
20
21 # clean up the docker build environment
22 cd "$WORKSPACE"
23 cd docker
24 ./build.sh realclean
25
26 rm -f config.yml
27
28 # Get test config.yml file
29 cp $HOME/docker/config.yml .
30
31 ./build.sh
32
33 ECODE=$?
34
35 if [[ "$ECODE" != "0" ]]; then
36   title "!!!!!! docker BUILD FAILED !!!!!!"
37   EXITCODE=$(($EXITCODE + $ECODE))
38 fi
39
40 title "docker build complete"
41
42 exit $EXITCODE