Tag Jenkins Canvas Docker Image with SHA

[change-merged]
[build-registry-path=jenkins/canvas-lms/de-247]

Fixes: DE-247

Test plan:
 - Spec Pass
 - Verify git_rev is the correct sha
 - Verify all tags upload
 - Verify the images uploaded are correct

flag=none

Change-Id: Icb159a39d90e6061e91742d4daff4a854d804cbd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247281
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
This commit is contained in:
Alex Slaughter 2020-09-09 16:25:35 -07:00
parent 83a260762a
commit b6df87f610
1 changed files with 7 additions and 2 deletions

9
Jenkinsfile vendored
View File

@ -517,9 +517,14 @@ pipeline {
// publish canvas-lms:$GERRIT_BRANCH (i.e. canvas-lms:master)
sh 'docker tag $PUBLISHABLE_TAG $MERGE_TAG'
sh 'docker tag $DEPENDENCIES_PATCHSET_IMAGE $DEPENDENCIES_MERGE_IMAGE'
def GIT_REV = sh(script: 'git rev-parse HEAD', returnStdout: true).trim()
sh "docker tag \$PUBLISHABLE_TAG \$BUILD_IMAGE:${GIT_REV}"
sh "docker tag \$DEPENDENCIES_PATCHSET_IMAGE \$DEPENDENCIES_IMAGE:${GIT_REV}"
// push *all* canvas-lms images (i.e. all canvas-lms prefixed tags)
sh './build/new-jenkins/docker-with-flakey-network-protection.sh push $MERGE_TAG'
sh './build/new-jenkins/docker-with-flakey-network-protection.sh push $DEPENDENCIES_MERGE_IMAGE'
sh './build/new-jenkins/docker-with-flakey-network-protection.sh push $BUILD_IMAGE'
sh './build/new-jenkins/docker-with-flakey-network-protection.sh push $DEPENDENCIES_IMAGE'
}
}
}