Skip to content

Commit

Permalink
test(e2e): tag CI images only on success
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswldenyer committed Apr 14, 2021
1 parent 0723db9 commit 7730944
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ pipeline {
// Build images (REGISTRY is set in jenkin's global configuration).
// Note: We might want to build and test dev images that have more
// assertions instead but that complicates e2e tests a bit.
sh "./scripts/release.sh --alias-tag \"${e2e_alias_tag}\" --registry \"${env.REGISTRY}\""
sh "./scripts/release.sh --registry \"${env.REGISTRY}\""
}
post {
// Always remove all docker images because they are usually used just once
Expand Down Expand Up @@ -484,6 +484,29 @@ pipeline {
}// end of "e2e tests" stage
}// parallel stages block
}// end of test stage

// On develop, push tagged images to the CI repo if all tests have passed.
// Tag as 'nightly' if it was a nightly run, otherwise 'ci'.
stage('e2e push tagged images to CI repo') {
agent { label 'nixos-mayastor' }
when {
beforeAgent true
allOf {
expression { e2e_build_images == true }
branch 'develop'
}
}
steps {
// Build, tag and push the built images to the CI registry, but only after the test has succeeded
sh "./scripts/release.sh --alias-tag \"${e2e_alias_tag}\" --registry \"${env.REGISTRY}\" "
}
post {
always {
sh 'docker image prune --all --force'
}
}
}

stage('push images') {
agent { label 'nixos-mayastor' }
when {
Expand Down

0 comments on commit 7730944

Please sign in to comment.