]> rtime.felk.cvut.cz Git - jailhouse.git/blob - ci/build-all-configs.sh
ci: Break the build properly if anything goes wrong
[jailhouse.git] / ci / build-all-configs.sh
1 #!/bin/bash
2 #
3 # Jailhouse, a Linux-based partitioning hypervisor
4 #
5 # Copyright (c) Siemens AG, 2015, 2016
6 #
7 # Authors:
8 #  Jan Kiszka <jan.kiszka@siemens.com>
9 #
10 # This work is licensed under the terms of the GNU GPL, version 2.  See
11 # the COPYING file in the top-level directory.
12 #
13
14 set -e
15
16 CONFIGS="x86 banana-pi vexpress"
17
18 # only build a specific config if the branch selects it
19 if [ ${TRAVIS_BRANCH#coverity_scan-} != ${TRAVIS_BRANCH} ]; then
20         CONFIGS=${TRAVIS_BRANCH#coverity_scan-}
21 fi
22
23 PREFIX=
24 if [ "$1" == "--cov" ]; then
25         export COVERITY_UNSUPPORTED=1
26         PREFIX="cov-build --append-log --dir $2 $3"
27 fi
28
29 for CONFIG in $CONFIGS; do
30         echo
31         echo "*** Building configuration $CONFIG ***"
32
33         cp ci/jailhouse-config-$CONFIG.h hypervisor/include/jailhouse/config.h
34
35         case $CONFIG in
36         x86)
37                 ARCH=x86_64
38                 CROSS_COMPILE=
39                 ;;
40         *)
41                 ARCH=arm
42                 CROSS_COMPILE=arm-linux-gnueabihf-
43                 ;;
44         esac
45
46         $PREFIX make KDIR=ci/linux/build-$CONFIG ARCH=$ARCH \
47              CROSS_COMPILE=$CROSS_COMPILE
48
49         # Keep the clean run out of sight for cov-build so that results are
50         # accumulated as far as possible. Multiple compilations of the same
51         # file will still leave only the last run in the results.
52         make KDIR=ci/linux/build-$CONFIG ARCH=$ARCH \
53              CROSS_COMPILE=$CROSS_COMPILE clean
54 done