3 # Run this script from the root of the systemd's git repository
4 # or set REPO_ROOT to a correct path.
6 # Example execution on Fedora:
8 # systemctl start docker
9 # export CONT_NAME="my-fancy-container"
10 # travis-ci/managers/fedora.sh SETUP RUN CLEANUP
12 PHASES
=(${@:-SETUP RUN CLEANUP})
13 FEDORA_RELEASE
="${FEDORA_RELEASE:-rawhide}"
14 CONT_NAME
="${CONT_NAME:-fedora-$FEDORA_RELEASE-$RANDOM}"
15 DOCKER_EXEC
="${DOCKER_EXEC:-docker exec -it $CONT_NAME}"
16 DOCKER_RUN
="${DOCKER_RUN:-docker run}"
17 REPO_ROOT
="${REPO_ROOT:-$PWD}"
18 ADDITIONAL_DEPS
=(dnf-plugins-core python2 iputils hostname libasan
)
21 echo -e "\033[33;1m$1\033[0m"
26 for phase
in "${PHASES[@]}"; do
30 info
"Using Fedora $FEDORA_RELEASE"
31 # Pull a Docker image and start a new container
32 docker pull fedora
:$FEDORA_RELEASE
33 info
"Starting container $CONT_NAME"
34 $DOCKER_RUN -v $REPO_ROOT:/build
:rw \
35 -w /build
--privileged=true
--name $CONT_NAME \
36 -dit --net=host fedora
:$FEDORA_RELEASE /sbin
/init
37 # Beautiful workaround for Fedora's version of Docker
39 $DOCKER_EXEC dnf makecache
40 # Install necessary build/test requirements
41 $DOCKER_EXEC dnf
-y --exclude selinux-policy\
* upgrade
42 $DOCKER_EXEC dnf
-y install "${ADDITIONAL_DEPS[@]}"
43 $DOCKER_EXEC dnf
-y builddep systemd
48 $DOCKER_EXEC meson build
49 $DOCKER_EXEC ninja
-C build
50 $DOCKER_EXEC sh
-c "printf '#!/bin/sh\necho The test is failing for unknown reason, skipping; exit 77' >/build/build/test-capability"
52 $DOCKER_EXEC ninja
-C build
test
56 docker stop
$CONT_NAME
57 docker
rm -f $CONT_NAME
60 echo >&2 "Unknown phase '$phase'"