Fix parameter ordering for minor change in cwltool command line semantics. no issue #
[arvados-dev.git] / jenkins / run-build-packages-all-targets.sh
1 #!/bin/bash
2
3 # Orchestrate run-build-packages.sh for every target.
4
5 set -e
6
7 FINAL_EXITCODE=0
8 JENKINS_DIR=$(dirname "$(readlink -e "$0")")
9
10 run_docker() {
11     local tag=$1; shift
12     if docker run -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \
13           --env ARVADOS_DEBUG=1 "arvados/build:$tag"; then
14         # Success - nothing more to do.
15         true
16     else
17         FINAL_EXITCODE=$?
18         echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2
19     fi
20 }
21
22 # In case it's needed, build the containers. This costs just a few
23 # seconds when the containers already exist, so it's not a big deal to
24 # do it on each run.
25 cd "$JENKINS_DIR/dockerfiles"
26 time ./build-all-build-containers.sh
27
28 for dockerfile_path in $(find -name Dockerfile); do
29     run_docker "$(basename $(dirname "$dockerfile_path"))"
30 done
31
32 exit $FINAL_EXITCODE