Skip to content

Commit

Permalink
[ci][docker] Fix deploy to tlcpackstaging on Docker Hub (#12282)
Browse files Browse the repository at this point in the history
This was previously broken since it wouldn't pick up the new images names and there was an errant `'` floating around
  • Loading branch information
driazati authored Aug 3, 2022
1 parent fefc27f commit 85624ff
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 21 deletions.
52 changes: 34 additions & 18 deletions Jenkinsfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions ci/jenkins/Deploy.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ stage('Build packages') {


def update_docker(ecr_image, hub_image) {
if (ecr_image == null) {
sh("image was not rebuilt, skipping")
return
}
if (!ecr_image.contains("amazonaws.com")) {
sh("echo Skipping '${ecr_image}' since it doesn't look like an ECR image")
sh("echo \"Skipping '${ecr_image}' -> '${hub_image}' since it doesn\'t look like an ECR image\"")
return
}
docker_init(ecr_image)
Expand Down Expand Up @@ -106,7 +110,7 @@ def deploy() {
).trim()
def tag = "${date_Ymd_HMS}-${upstream_revision.substring(0, 8)}"
{% for image in images %}
update_docker({{ image.name }}, "tlcpackstaging/{{ image.name }}:${tag}")
update_docker(built_{{ image.name }}, "tlcpackstaging/{{ image.name }}:${tag}")
{% endfor %}
} finally {
sh(
Expand Down
2 changes: 1 addition & 1 deletion ci/jenkins/DockerBuild.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def build_docker_images() {
// We're purposefully not setting the built image here since they
// are not yet being uploaded to tlcpack
// {{ image.name }} = build_image('{{ image.name }}')
build_image('{{ image.name }}')
built_{{ image.name }} = build_image('{{ image.name }}');
}
}
},
Expand Down
6 changes: 6 additions & 0 deletions ci/jenkins/Jenkinsfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ properties([
])
])

// Placeholders for newly built Docker image names (if rebuild_docker_images
// is used)
{% for image in images %}
built_{{ image.name }} = null;
{% endfor %}

// Global variable assigned during Sanity Check that holds the sha1 which should be
// merged into the PR in all branches.
upstream_revision = null
Expand Down
1 change: 1 addition & 0 deletions ci/jenkins/Prepare.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def prepare() {
script: './tests/scripts/git_change_docker.sh',
label: 'Check for any docker changes',
)

if (skip_ci) {
// Don't rebuild when skipping CI
rebuild_docker_images = false
Expand Down

0 comments on commit 85624ff

Please sign in to comment.