From 2ac9a5b73c8bee27f0b3dbb024f9c4da34926662 Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Fri, 20 Nov 2020 17:44:34 +0100 Subject: [PATCH] schutzbot: don't copy dnf repo file between stages Repository URLs are predictable. There's no need to use Jenkins' stash feature to pass the repo file between stages. Instead, simply create the repo file where it is needed, in deploy.sh. --- schutzbot/Jenkinsfile | 10 ---------- schutzbot/deploy.sh | 13 +++++++++---- schutzbot/mockbuild.sh | 12 ------------ 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/schutzbot/Jenkinsfile b/schutzbot/Jenkinsfile index 3e897f1..14ac1f5 100644 --- a/schutzbot/Jenkinsfile +++ b/schutzbot/Jenkinsfile @@ -50,10 +50,6 @@ pipeline { retry(3) { sh "schutzbot/mockbuild.sh" } - stash ( - includes: 'mock.repo', - name: 'fedora32' - ) } } stage('EL8') { @@ -67,10 +63,6 @@ pipeline { retry(3) { sh "schutzbot/mockbuild.sh" } - stash ( - includes: 'mock.repo', - name: 'rhel8cdn' - ) } } } @@ -86,7 +78,6 @@ pipeline { AWS_CREDS = credentials('aws-credentials-osbuildci') } steps { - unstash 'fedora32' run_tests('integration') } post { @@ -103,7 +94,6 @@ pipeline { RHN_REGISTRATION_SCRIPT = credentials('rhn-register-script-production') } steps { - unstash 'rhel8cdn' run_tests('integration') } post { diff --git a/schutzbot/deploy.sh b/schutzbot/deploy.sh index fb760ec..e2eb359 100755 --- a/schutzbot/deploy.sh +++ b/schutzbot/deploy.sh @@ -62,13 +62,18 @@ fi # Add osbuild team ssh keys. cat schutzbot/team_ssh_keys.txt | tee -a ~/.ssh/authorized_keys > /dev/null -# Set up a dnf repository for the RPMs we built via mock. -sudo cp mock.repo /etc/yum.repos.d/ - # Set up dnf repositories with the RPMs we want to test sudo tee /etc/yum.repos.d/osbuild.repo << EOF -[osbuild] +[koji-osbuild] name=osbuild ${GIT_COMMIT} +baseurl=${DNF_REPO_BASEURL}/koji-osbuild/${ID}-${VERSION_ID}/${ARCH}/${GIT_COMMIT} +enabled=1 +gpgcheck=0 +# Default dnf repo priority is 99. Lower number means higher priority. +priority=5 + +[osbuild] +name=osbuild ${OSBUILD_COMMIT} baseurl=${DNF_REPO_BASEURL}/osbuild/${ID}-${VERSION_ID}/${ARCH}/${OSBUILD_COMMIT} enabled=1 gpgcheck=0 diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index b08b025..b6a07c5 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -87,15 +87,3 @@ greenprint "☁ Uploading RPMs to S3" pushd repo s3cmd --acl-public sync . s3://${REPO_BUCKET}/ popd - -# Create a repository file. -greenprint "📜 Generating dnf repository file" -tee mock.repo << EOF -[schutzbot-mock] -name=schutzbot mock ${GIT_SHA} ${ID}${VERSION_ID//./} -baseurl=${REPO_URL} -enabled=1 -gpgcheck=0 -# Default dnf repo priority is 99. Lower number means higher priority. -priority=5 -EOF