5 echo >&2 "usage: $0 [options]"
8 echo >&2 " -u, --upload Upload the images (docker push)"
9 echo >&2 " -h, --help Display this help and exit"
11 echo >&2 " If no options are given, just builds the images."
16 # NOTE: This requires GNU getopt (part of the util-linux package on Debian-based distros).
21 if [ $? != 0 ] ; then echo "Use -h for help"; exit 1 ; fi
22 # Note the quotes around `$TEMP': they are essential!
49 printf "\n%*s\n\n" $(((${#title}+$COLUMNS)/2)) "********** $1 **********"
53 # Sometimes docker push fails; retry it a few times if necessary.
54 for i in `seq 1 5`; do
57 if [[ "$ECODE" == "0" ]]; then
62 if [[ "$ECODE" != "0" ]]; then
63 title "!!!!!! docker push $* failed !!!!!!"
64 EXITCODE=$(($EXITCODE + $ECODE))
73 echo -n "$(($SECONDS - $t0))s"
77 if ! [[ -n "$WORKSPACE" ]]; then
79 echo >&2 "Error: WORKSPACE environment variable not set"
86 # find the docker binary
87 DOCKER=`which docker.io`
89 if [[ "$DOCKER" == "" ]]; then
93 if [[ "$DOCKER" == "" ]]; then
94 title "Error: you need to have docker installed. Could not find the docker executable."
99 title "Starting docker build"
103 # clean up the docker build environment
110 # Get test config.yml file
111 cp $HOME/docker/config.yml .
117 if [[ "$ECODE" != "0" ]]; then
118 title "!!!!!! docker BUILD FAILED !!!!!!"
119 EXITCODE=$(($EXITCODE + $ECODE))
122 title "docker build complete (`timer`)"
124 title "uploading images"
128 if [[ "$ECODE" != "0" ]]; then
129 title "upload arvados images SKIPPED because build failed"
131 if [[ $upload == true ]]; then
132 docker_push arvados/api
133 docker_push arvados/compute
134 docker_push arvados/doc
135 docker_push arvados/workbench
136 docker_push arvados/keep
137 docker_push arvados/keepproxy
138 docker_push arvados/shell
139 docker_push arvados/sso
140 title "upload arvados images complete (`timer`)"
142 title "upload arvados images SKIPPED because no --upload option set"
146 title "Starting docker java-bwa-samtools build"
150 ./build.sh java-bwa-samtools-image
154 if [[ "$ECODE" != "0" ]]; then
155 title "!!!!!! docker java-bwa-samtools BUILD FAILED !!!!!!"
156 EXITCODE=$(($EXITCODE + $ECODE))
159 title "docker build java-bwa-samtools complete (`timer`)"
163 if [[ "$ECODE" != "0" ]]; then
164 title "upload arvados/jobs image SKIPPED because build failed"
166 if [[ $upload == true ]]; then
167 title "upload arvados/jobs image"
168 docker_push arvados/jobs
169 title "upload arvados/jobs image complete (`timer`)"
171 title "upload arvados images SKIPPED because no --upload option set"