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-14 13:30:40 +01:00 committed by Tom Gundersen
parent 5aee7b9fa7
commit 2fa87a0e46
3 changed files with 11 additions and 30 deletions

15
schutzbot/Jenkinsfile vendored
View file

@ -40,10 +40,6 @@ pipeline {
steps {
sh "schutzbot/ci_details.sh"
sh "schutzbot/mockbuild.sh"
stash (
includes: 'osbuild-mock.repo',
name: 'fedora32'
)
}
}
stage('Fedora 33') {
@ -54,10 +50,6 @@ pipeline {
steps {
sh "schutzbot/ci_details.sh"
sh "schutzbot/mockbuild.sh"
stash (
includes: 'osbuild-mock.repo',
name: 'fedora33'
)
}
}
stage('RHEL 8 CDN') {
@ -69,10 +61,6 @@ pipeline {
steps {
sh "schutzbot/ci_details.sh"
sh "schutzbot/mockbuild.sh"
stash (
includes: 'osbuild-mock.repo',
name: 'rhel8cdn'
)
}
}
}
@ -90,7 +78,6 @@ pipeline {
DISTRO_CODE = "fedora32"
}
steps {
unstash 'fedora32'
run_tests()
}
post {
@ -107,7 +94,6 @@ pipeline {
DISTRO_CODE = "fedora33"
}
steps {
unstash 'fedora33'
run_tests()
}
post {
@ -125,7 +111,6 @@ pipeline {
DISTRO_CODE = "rhel8"
}
steps {
unstash 'rhel8cdn'
run_tests()
}
post {

View file

@ -20,6 +20,7 @@ function retry {
# Get OS details.
source /etc/os-release
ARCH=$(uname -m)
# Register RHEL if we are provided with a registration script.
if [[ -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then
@ -49,9 +50,16 @@ 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 osbuild-mock.repo /etc/yum.repos.d/osbuild-mock.repo
sudo dnf repository-packages osbuild-mock list
# Set up a dnf repository with the RPMs we want to test
sudo tee /etc/yum.repos.d/osbuild.repo << EOF
[osbuild]
name=osbuild ${GIT_COMMIT}
baseurl=http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com/osbuild/${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
# Set up EPEL repository (for ansible and koji)

View file

@ -90,15 +90,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 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