2017-04-28 19:29:25 +03:00
#!/usr/bin/bash
# Install build dependencies, run unit tests and installed tests.
set -xeuo pipefail
dn = $( dirname $0 )
. ${ dn } /libbuild.sh
2017-04-28 18:40:22 +03:00
# Use the latest ostree by default
2017-07-17 20:40:25 +03:00
id = $( . /etc/os-release && echo $ID )
version_id = $( . /etc/os-release && echo $VERSION_ID )
if [ " $id " = = fedora ] && [ " $version_id " = = 26 ] ; then
2017-09-26 18:41:29 +03:00
echo -e '[fahc]\nmetadata_expire=1m\nbaseurl=https://ci.centos.org/artifacts/sig-atomic/fahc/rdgo/build/\ngpgcheck=0\n' > /etc/yum.repos.d/fahc.repo
2017-07-17 20:40:25 +03:00
# Until we fix https://github.com/rpm-software-management/libdnf/pull/149
sed -i -e 's,metadata_expire=6h,exclude=ostree ostree-devel ostree-libs ostree-grub2\nmetadata_expire=6h,' /etc/yum.repos.d/fedora-updates.repo
elif [ " $id " = = centos ] ; then
2017-09-26 18:41:29 +03:00
echo -e '[cahc]\nmetdata_expire=1m\nbaseurl=https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/build\ngpgcheck=0\n' > /etc/yum.repos.d/cahc.repo
2017-07-17 20:40:25 +03:00
fi
2017-04-28 19:29:25 +03:00
2017-09-06 20:53:46 +03:00
pkg_upgrade
2017-09-19 17:40:35 +03:00
pkg_install_builddeps rpm-ostree
2017-07-13 23:39:01 +03:00
# Mostly dependencies for tests
2017-10-04 22:48:26 +03:00
pkg_install ostree{ ,-devel,-grub2} createrepo_c /usr/bin/jq PyYAML \
2017-09-18 22:11:26 +03:00
libubsan libasan libtsan elfutils fuse sudo python-gobject-base \
2017-11-16 05:28:03 +03:00
selinux-policy-devel selinux-policy-targeted
2017-10-04 22:48:26 +03:00
# For ex-container tests and clang build
pkg_install_if_os fedora parallel clang
2017-04-28 19:29:25 +03:00
2017-09-06 20:53:46 +03:00
if [ -n " ${ CI_PKGS :- } " ] ; then
pkg_install ${ CI_PKGS }
fi
2017-04-28 19:29:25 +03:00
# create an unprivileged user for testing
adduser testuser
2017-09-19 17:40:35 +03:00
export LSAN_OPTIONS = verbosity = 1:log_threads= 1
2017-10-06 00:14:11 +03:00
BWRAP = /usr/bin/bwrap
if [ " $id " = = centos ] ; then
BWRAP = /usr/lib64/rpm-ostree/bwrap
fi
build --enable-installed-tests --enable-gtk-doc --with-bubblewrap= $BWRAP