# /proc and /sys in the chroot).
mkdir -p /root/rpmbuild/SOURCES
cp package/* /root/rpmbuild/SOURCES
-rpmbuild -bb --with coverage -D "fedora_version 25" -D "jobs `nproc`" package/*.spec
+rpmbuild -bb --with coverage -D "fedora_version $DOCKER_TAG" -D "jobs `nproc`" package/*.spec
# test the %pre/%post scripts by installing/updating/removing the built packages
# ignore the dependencies to make the test easier, as a smoke test it's good enough
env:
- BUILD_FLAVOR=tumbleweed
- BUILD_FLAVOR=leap
- - BUILD_FLAVOR=fedora
+ - BUILD_FLAVOR=fedora DOCKER_TAG=31
- BUILD_FLAVOR=ubuntu DOCKER_TAG=18.10
- BUILD_FLAVOR=debian DOCKER_TAG=9
script:
# run the respective .travis.<distro>.sh script
# (--privileged: integration tests mount a loopback device etc.)
- - docker run --privileged -it -e COVERALLS_TOKEN="$COVERALLS_TOKEN" snapper-devel ./.travis.$BUILD_FLAVOR.sh
+ - docker run --privileged -it -e COVERALLS_TOKEN="$COVERALLS_TOKEN" -e DOCKER_TAG=$DOCKER_TAG snapper-devel ./.travis.$BUILD_FLAVOR.sh
-# Build Fedora 31 image
-FROM fedora:31
+# https://docs.docker.com/engine/reference/builder/#from
+ARG BUILD_FLAVOR
+ARG DOCKER_TAG
+
+FROM ${BUILD_FLAVOR}:${DOCKER_TAG}
RUN dnf -y install \
acl \