Skip to content

Commit

Permalink
Move set-expiration of Server container to a conditional pipeline sta…
Browse files Browse the repository at this point in the history
…ge (distributed-system-analysis#3357)

Move the setting of the expiration date to its own pipeline stage which
is executed only for PRs, so that branch builds will not expire.

PBENCH-1113
  • Loading branch information
webbnh authored Mar 29, 2023
1 parent f99f059 commit 386c256
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jenkins/Pipeline.gy
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,19 @@ pipeline {
KEYCLOAK_CLIENT_SECRET=credentials('5cf0304d-8a00-48a4-ade5-9f59cb37ba68')
PB_SERVER_IMAGE_TAG="${PB_IMAGE_TAG}"
RPM_PATH="${WORKSPACE_TMP}/rpmbuild/RPMS/noarch/pbench-server-*.rpm"
EXPIRATION="""${sh(returnStdout: true, script: 'date --date "3 weeks" "+%s"').trim()}"""
}
steps {
sh 'buildah login -u="${PB_CI_REG_CRED_USR}" -p="${PB_CI_REG_CRED_PSW}" ${PB_CI_REGISTRY}'
sh 'bash -ex ./server/pbenchinacan/container-build.sh'
sh 'buildah push ${PB_CONTAINER_REG}/${PB_SERVER_IMAGE_NAME}:${PB_IMAGE_TAG}'
}
}
stage('For PRs, set the Pbench Server container image expiration') {
when { changeRequest() }
environment {
EXPIRATION="""${sh(returnStdout: true, script: 'date --date "3 weeks" "+%s"').trim()}"""
}
steps {
sh './jenkins/set-expiration \
${EXPIRATION} \
${PB_CI_REGISTRY} \
Expand Down

0 comments on commit 386c256

Please sign in to comment.