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 )
2018-06-28 22:31:13 +03:00
if [ " $id " = = fedora ] && [ " $version_id " = = 28 ] ; 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
2018-04-05 17:51:23 +03:00
excludes = 'exclude=ostree ostree-libs ostree-grub2 rpm-ostree'
for repo in /etc/yum.repos.d/fedora*.repo; do
cat ${ repo } | ( while read line; do if echo " $line " | grep -qE -e '^enabled=1' ; then echo " ${ excludes } " ; fi ; echo $line ; done ) > ${ repo } .new
mv ${ repo } .new ${ repo }
done
2017-07-17 20:40:25 +03:00
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
2018-07-16 22:05:37 +03:00
# Temporary until spec file changes are upstreamed
pkg_install_if_os fedora python3-sphinx python3-devel
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 \
2018-02-14 17:27:06 +03:00
selinux-policy-devel selinux-policy-targeted python2-createrepo_c \
rpm-python # provided by python2-rpm on Fedora
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
2018-01-18 00:25:39 +03:00
# And now the build
build --enable-installed-tests --enable-gtk-doc ${ CONFIGOPTS :- }