From 146d50544094da7a0fea965f9b7d8e9fd64230b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ladislav=20Slez=C3=A1k?= Date: Fri, 19 Jun 2020 16:00:20 +0200 Subject: [PATCH] Improve openSUSE Travis builds - Do not mix the Leap and Tumbleweed YaST repositories - Pin the openSUSE version to 15.1 (the "latest" might be switched to 15.2 anytime in the future causing inconsistenty with the used 15.1 YaST repository) - Later we can run 15.1 and 15.2 in parallel if needed or just switch from 15.1 to 15.2 --- .travis.yml | 12 ++++++------ Dockerfile.tumbleweed | 9 ++++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index d5f543c6..d6c706d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,15 +5,15 @@ services: # define the build matrix env: - - BUILD_FLAVOR=tumbleweed - - BUILD_FLAVOR=leap - - BUILD_FLAVOR=fedora DOCKER_TAG=31 - - BUILD_FLAVOR=ubuntu DOCKER_TAG=19.10 - - BUILD_FLAVOR=debian DOCKER_TAG=10 + - BUILD_FLAVOR=tumbleweed DOCKER_TAG=latest YAST_REPO=openSUSE_Tumbleweed + - BUILD_FLAVOR=leap DOCKER_TAG=15.1 YAST_REPO=openSUSE_Leap_15.1_Update + - BUILD_FLAVOR=fedora DOCKER_TAG=31 + - BUILD_FLAVOR=ubuntu DOCKER_TAG=19.10 + - BUILD_FLAVOR=debian DOCKER_TAG=10 before_install: # use the Dockerfile. file for building the image - - docker build -f Dockerfile.$BUILD_FLAVOR -t snapper-devel --build-arg BUILD_FLAVOR=$BUILD_FLAVOR --build-arg DOCKER_TAG=$DOCKER_TAG . + - docker build -f Dockerfile.$BUILD_FLAVOR -t snapper-devel --build-arg BUILD_FLAVOR=$BUILD_FLAVOR --build-arg DOCKER_TAG=$DOCKER_TAG --build-arg YAST_REPO=$YAST_REPO . script: # run the respective .travis..sh script diff --git a/Dockerfile.tumbleweed b/Dockerfile.tumbleweed index 5562dd6c..eab35e35 100644 --- a/Dockerfile.tumbleweed +++ b/Dockerfile.tumbleweed @@ -2,9 +2,13 @@ # so use a parametrized Dockerfile. See # https://docs.docker.com/engine/reference/builder/#from ARG BUILD_FLAVOR +ARG DOCKER_TAG # Build the latest openSUSE Tumbleweed or Leap image -FROM opensuse/${BUILD_FLAVOR} +FROM opensuse/${BUILD_FLAVOR}:${DOCKER_TAG} + +# this one needs to be defined after "FROM" so the value is available in "RUN" later +ARG YAST_REPO # the NON-OSS repo is not needed, save the network bandwidth and some time (~5 seconds) for each refresh RUN zypper mr -d repo-non-oss @@ -16,8 +20,7 @@ RUN zypper mr -d repo-non-oss RUN zypper --non-interactive in --no-recommends --force-resolution util-linux ruby && zypper clean -a # add the YaST repository - we need rubygem-coveralls-lcov -RUN zypper ar -f http://download.opensuse.org/repositories/YaST:/Head/openSUSE_Tumbleweed/ yast_tw -RUN zypper ar -f http://download.opensuse.org/repositories/YaST:/Head/openSUSE_Leap_15.1_Update/ yast_lp +RUN zypper ar -f http://download.opensuse.org/repositories/YaST:/Head/${YAST_REPO}/ yast RUN RUBY_VERSION=ruby:`rpm --eval '%{rb_ver}'` && \ zypper --non-interactive --gpg-auto-import-keys \ in --no-recommends \ -- 2.47.3