From 625f372e995a89bf18ab8c09bd0ef7cad674c501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Fri, 5 Apr 2024 15:05:18 +0200 Subject: [PATCH] WIP: refresh zypper cache before running tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Maybe this will reduce flukes 🤞 --- bci_tester/data.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bci_tester/data.py b/bci_tester/data.py index 33698bd8..dd11e3f0 100755 --- a/bci_tester/data.py +++ b/bci_tester/data.py @@ -195,9 +195,13 @@ def create_container_version_mark( if BCI_DEVEL_REPO is None: BCI_DEVEL_REPO = f"https://updates.suse.com/SUSE/Products/SLE-BCI/{OS_MAJOR_VERSION}-SP{OS_SP_VERSION}/{LOCALHOST.system_info.arch}/product/" - _BCI_REPLACE_REPO_CONTAINERFILE = "" + _BCI_REPLACE_REPO_CONTAINERFILE = "RUN if command -v zypper; then zypper ref; fi" else: - _BCI_REPLACE_REPO_CONTAINERFILE = f"RUN sed -i 's|baseurl.*|baseurl={BCI_DEVEL_REPO}|' /etc/zypp/repos.d/{BCI_REPO_NAME}.repo" + _BCI_REPLACE_REPO_CONTAINERFILE = f"""RUN if command -v zypper; then \ + sed -i 's|baseurl.*|baseurl={BCI_DEVEL_REPO}|' /etc/zypp/repos.d/{BCI_REPO_NAME}.repo; \ + zypper ref; \ + fi +""" _IMAGE_TYPE_T = Literal["dockerfile", "kiwi"]