From c686dbe03a5b30d7f56cf23be8f0c1de71ad1349 Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Sat, 14 Nov 2020 13:32:05 +0100 Subject: [PATCH] mockbuild: don't build repository when it already exists This avoids doing unnecessary work and speeds up restarting tests. --- schutzbot/mockbuild.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index a9c3710c..0cfdd6b2 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -57,6 +57,12 @@ REPO_DIR=repo/${REPO_PATH} # Full URL to the RPM repository after they are uploaded. REPO_URL=${MOCK_REPO_BASE_URL}/${REPO_PATH} +# Don't rerun the build if it already exists +if curl --silent --fail --head --output /dev/null "${REPO_URL}/repodata/repomd.xml"; then + greenprint "🎁 Repository already exists. Exiting." + exit 0 +fi + # Print some data. greenprint "🧬 Using mock config: ${MOCK_CONFIG}" greenprint "📦 SHA: ${COMMIT}"