schutzbot: don't copy dnf repo file between stages

Now that the repository URLs are predictable, don't use Jenkins' stash
feature to pass the repo file between stages.

Instead, simply create the repo file where it is needed, in deploy.sh.
This commit is contained in:
Lars Karlitski 2020-11-11 23:15:30 +01:00 committed by Ondřej Budai
parent 692a8076bb
commit 4bd891be9e
3 changed files with 11 additions and 39 deletions

24
schutzbot/Jenkinsfile vendored
View file

@ -51,10 +51,6 @@ pipeline {
retry(3) { retry(3) {
sh "schutzbot/mockbuild.sh" sh "schutzbot/mockbuild.sh"
} }
stash (
includes: 'osbuild-mock.repo',
name: 'fedora32'
)
} }
} }
stage('F33') { stage('F33') {
@ -68,10 +64,6 @@ pipeline {
retry(3) { retry(3) {
sh "schutzbot/mockbuild.sh" sh "schutzbot/mockbuild.sh"
} }
stash (
includes: 'osbuild-mock.repo',
name: 'fedora33'
)
} }
} }
stage('EL8') { stage('EL8') {
@ -86,10 +78,6 @@ pipeline {
retry(3) { retry(3) {
sh "schutzbot/mockbuild.sh" sh "schutzbot/mockbuild.sh"
} }
stash (
includes: 'osbuild-mock.repo',
name: 'rhel8cdn'
)
} }
} }
} }
@ -102,7 +90,6 @@ pipeline {
agent { label "f32cloudbase && x86_64 && aws" } agent { label "f32cloudbase && x86_64 && aws" }
environment { TEST_TYPE = "base" } environment { TEST_TYPE = "base" }
steps { steps {
unstash 'fedora32'
run_tests('base') run_tests('base')
} }
post { post {
@ -123,7 +110,6 @@ pipeline {
DISTRO_CODE = "fedora32" DISTRO_CODE = "fedora32"
} }
steps { steps {
unstash 'fedora32'
run_tests('image') run_tests('image')
} }
post { post {
@ -144,7 +130,6 @@ pipeline {
AWS_IMAGE_TEST_CREDS = credentials('aws-credentials-osbuild-image-test') AWS_IMAGE_TEST_CREDS = credentials('aws-credentials-osbuild-image-test')
} }
steps { steps {
unstash 'fedora32'
run_tests('integration') run_tests('integration')
} }
post { post {
@ -156,7 +141,6 @@ pipeline {
stage('F32 OSTree') { stage('F32 OSTree') {
agent { label "f32cloudbase && psi && x86_64" } agent { label "f32cloudbase && psi && x86_64" }
steps { steps {
unstash 'fedora32'
run_tests('ostree') run_tests('ostree')
} }
post { post {
@ -169,7 +153,6 @@ pipeline {
agent { label "f33cloudbase && x86_64 && aws" } agent { label "f33cloudbase && x86_64 && aws" }
environment { TEST_TYPE = "base" } environment { TEST_TYPE = "base" }
steps { steps {
unstash 'fedora33'
run_tests('base') run_tests('base')
} }
post { post {
@ -190,7 +173,6 @@ pipeline {
DISTRO_CODE = "fedora33" DISTRO_CODE = "fedora33"
} }
steps { steps {
unstash 'fedora33'
run_tests('image') run_tests('image')
} }
post { post {
@ -207,7 +189,6 @@ pipeline {
AWS_IMAGE_TEST_CREDS = credentials('aws-credentials-osbuild-image-test') AWS_IMAGE_TEST_CREDS = credentials('aws-credentials-osbuild-image-test')
} }
steps { steps {
unstash 'fedora33'
run_tests('integration') run_tests('integration')
} }
post { post {
@ -219,7 +200,6 @@ pipeline {
stage('F33 OSTree') { stage('F33 OSTree') {
agent { label "f33cloudbase && psi && x86_64" } agent { label "f33cloudbase && psi && x86_64" }
steps { steps {
unstash 'fedora33'
run_tests('ostree') run_tests('ostree')
} }
post { post {
@ -235,7 +215,6 @@ pipeline {
RHN_REGISTRATION_SCRIPT = credentials('rhn-register-script-production') RHN_REGISTRATION_SCRIPT = credentials('rhn-register-script-production')
} }
steps { steps {
unstash 'rhel8cdn'
run_tests('base') run_tests('base')
} }
post { post {
@ -257,7 +236,6 @@ pipeline {
DISTRO_CODE = "rhel8" DISTRO_CODE = "rhel8"
} }
steps { steps {
unstash 'rhel8cdn'
run_tests('image') run_tests('image')
} }
post { post {
@ -279,7 +257,6 @@ pipeline {
RHN_REGISTRATION_SCRIPT = credentials('rhn-register-script-production') RHN_REGISTRATION_SCRIPT = credentials('rhn-register-script-production')
} }
steps { steps {
unstash 'rhel8cdn'
run_tests('integration') run_tests('integration')
} }
post { post {
@ -291,7 +268,6 @@ pipeline {
stage('EL8 OSTree') { stage('EL8 OSTree') {
agent { label "rhel8cloudbase && psi && x86_64" } agent { label "rhel8cloudbase && psi && x86_64" }
steps { steps {
unstash 'rhel8cdn'
run_tests('ostree') run_tests('ostree')
} }
post { post {

View file

@ -25,6 +25,7 @@ function retry {
# Get OS details. # Get OS details.
source /etc/os-release source /etc/os-release
ARCH=$(uname -m)
if [[ -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then if [[ -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then
greenprint "Registering RHEL" greenprint "Registering RHEL"
@ -38,9 +39,16 @@ echo -e "fastestmirror=1" | sudo tee -a /etc/dnf/dnf.conf
greenprint "Adding osbuild team ssh keys" greenprint "Adding osbuild team ssh keys"
cat schutzbot/team_ssh_keys.txt | tee -a ~/.ssh/authorized_keys > /dev/null cat schutzbot/team_ssh_keys.txt | tee -a ~/.ssh/authorized_keys > /dev/null
greenprint "Setting up a dnf repository for the RPMs we built via mock" greenprint "Setting up a dnf repository with the RPMs we want to test"
sudo cp osbuild-mock.repo /etc/yum.repos.d/osbuild-mock.repo sudo tee /etc/yum.repos.d/osbuild-composer.repo << EOF
sudo dnf repository-packages osbuild-mock list [osbuild-composer]
name=osbuild composer ${GIT_COMMIT}
baseurl=http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com/osbuild-composer/${ID}-${VERSION_ID}/${ARCH}/${GIT_COMMIT}
enabled=1
gpgcheck=0
# Default dnf repo priority is 99. Lower number means higher priority.
priority=5
EOF
if [[ $ID == rhel ]]; then if [[ $ID == rhel ]]; then
greenprint "Setting up EPEL repository" greenprint "Setting up EPEL repository"

View file

@ -81,15 +81,3 @@ greenprint "☁ Uploading RPMs to S3"
pushd repo pushd repo
s3cmd --acl-public sync . s3://${REPO_BUCKET}/ s3cmd --acl-public sync . s3://${REPO_BUCKET}/
popd popd
# Create a repository file.
greenprint "📜 Generating dnf repository file"
tee osbuild-mock.repo << EOF
[osbuild-mock]
name=osbuild mock ${COMMIT}
baseurl=${REPO_URL}
enabled=1
gpgcheck=0
# Default dnf repo priority is 99. Lower number means higher priority.
priority=5
EOF