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:
parent
5aee7b9fa7
commit
2fa87a0e46
3 changed files with 11 additions and 30 deletions
15
schutzbot/Jenkinsfile
vendored
15
schutzbot/Jenkinsfile
vendored
|
|
@ -40,10 +40,6 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
sh "schutzbot/ci_details.sh"
|
sh "schutzbot/ci_details.sh"
|
||||||
sh "schutzbot/mockbuild.sh"
|
sh "schutzbot/mockbuild.sh"
|
||||||
stash (
|
|
||||||
includes: 'osbuild-mock.repo',
|
|
||||||
name: 'fedora32'
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Fedora 33') {
|
stage('Fedora 33') {
|
||||||
|
|
@ -54,10 +50,6 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
sh "schutzbot/ci_details.sh"
|
sh "schutzbot/ci_details.sh"
|
||||||
sh "schutzbot/mockbuild.sh"
|
sh "schutzbot/mockbuild.sh"
|
||||||
stash (
|
|
||||||
includes: 'osbuild-mock.repo',
|
|
||||||
name: 'fedora33'
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('RHEL 8 CDN') {
|
stage('RHEL 8 CDN') {
|
||||||
|
|
@ -69,10 +61,6 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
sh "schutzbot/ci_details.sh"
|
sh "schutzbot/ci_details.sh"
|
||||||
sh "schutzbot/mockbuild.sh"
|
sh "schutzbot/mockbuild.sh"
|
||||||
stash (
|
|
||||||
includes: 'osbuild-mock.repo',
|
|
||||||
name: 'rhel8cdn'
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -90,7 +78,6 @@ pipeline {
|
||||||
DISTRO_CODE = "fedora32"
|
DISTRO_CODE = "fedora32"
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
unstash 'fedora32'
|
|
||||||
run_tests()
|
run_tests()
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
|
|
@ -107,7 +94,6 @@ pipeline {
|
||||||
DISTRO_CODE = "fedora33"
|
DISTRO_CODE = "fedora33"
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
unstash 'fedora33'
|
|
||||||
run_tests()
|
run_tests()
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
|
|
@ -125,7 +111,6 @@ pipeline {
|
||||||
DISTRO_CODE = "rhel8"
|
DISTRO_CODE = "rhel8"
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
unstash 'rhel8cdn'
|
|
||||||
run_tests()
|
run_tests()
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ function retry {
|
||||||
|
|
||||||
# Get OS details.
|
# Get OS details.
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
# Register RHEL if we are provided with a registration script.
|
# Register RHEL if we are provided with a registration script.
|
||||||
if [[ -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then
|
if [[ -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then
|
||||||
|
|
@ -49,9 +50,16 @@ fi
|
||||||
# Add osbuild team ssh keys.
|
# Add 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
|
||||||
|
|
||||||
# Set up a dnf repository for the RPMs we built via mock.
|
# Set 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.repo << EOF
|
||||||
sudo dnf repository-packages osbuild-mock list
|
[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
|
if [[ $ID == rhel ]]; then
|
||||||
# Set up EPEL repository (for ansible and koji)
|
# Set up EPEL repository (for ansible and koji)
|
||||||
|
|
|
||||||
|
|
@ -90,15 +90,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
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue