d47a2939f5f9006e2877bbfd966089dcbee3e5a7
[jackhill/mal.git] / .travis_build.sh
1 #!/bin/bash
2
3 set -ex
4
5 BUILD_IMPL=${BUILD_IMPL:-${IMPL}}
6
7 mode_var=${IMPL}_MODE
8 mode_val=${!mode_var}
9
10 # If NO_DOCKER is blank then launch use a docker image, otherwise
11 # use the Travis image/tools directly.
12 if [ -z "${NO_DOCKER}" ]; then
13 impl=$(echo "${IMPL}" | tr '[:upper:]' '[:lower:]')
14 img_impl=$(echo "${BUILD_IMPL}" | tr '[:upper:]' '[:lower:]')
15
16 docker pull kanaka/mal-test-${impl}
17 if [ "${impl}" != "${img_impl}" ]; then
18 docker pull kanaka/mal-test-${img_impl}
19 fi
20 if [ "${BUILD_IMPL}" = "rpython" ]; then
21 # rpython often fails on step9 in compute_vars_longevity
22 # so build step9, then continue wit the full build
23 docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${img_impl} \
24 make -C ${BUILD_IMPL} step9_try || true
25 fi
26 docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${img_impl} \
27 make ${mode_val:+${mode_var}=${mode_val}} \
28 -C ${BUILD_IMPL}
29 else
30 make ${mode_val:+${mode_var}=${mode_val}} \
31 -C ${BUILD_IMPL}
32 fi