Debian Codegraph @

tests/travis-run

raw
1 #!/bin/sh
2 set -eu
3 echo ${RELEASE:=zesty}
4 echo ${ARCH:=amd64}
5
6 # get LP chroot
7 CHROOT_URL=$(curl --silent https://api.launchpad.net/1.0/ubuntu/$RELEASE/$ARCH | grep -o 'http://[^ "]*chroot-ubuntu-[^ "]*')
8 CHROOT_TAR="/tmp/$(basename $CHROOT_URL)"
9 [ -e "$CHROOT_TAR" ] || curl -o "$CHROOT_TAR" "$CHROOT_URL"
10
11 # prepare chroot
12 BUILDDIR=$(mktemp -d)
13 trap "echo sudo rm -rf $BUILDDIR" EXIT INT QUIT PIPE
14 sudo tar -C "$BUILDDIR" -xf "$CHROOT_TAR"
15 CHROOT="$BUILDDIR/chroot-autobuild"
16 sudo cp /etc/resolv.conf "$CHROOT/etc/resolv.conf"
17
18 # copy code checkout into chroot
19 sudo cp -a . "$CHROOT/build/src"
20
21 sudo chroot "$CHROOT" << EOF
22 set -ex
23 # install build deps
24 apt-get update
25 apt-get install -y dh-autoreconf pkg-config libvirt-dev libglib2.0-dev libtool python3-gi python3-dbus python3-pytest dbus
26
27 # run build and tests as user
28 chown -R buildd:buildd /build
29 su - buildd <<EOU
30 set -ex
31 cd /build/src
32 ./autogen.sh
33 make -j4
34 make check || { cat test-suite.log; exit 1; }
35 EOU
36 EOF