Skip to content

Commit 85624ff

Browse files
authored
[ci][docker] Fix deploy to tlcpackstaging on Docker Hub (#12282)
This was previously broken since it wouldn't pick up the new images names and there was an errant `'` floating around
1 parent fefc27f commit 85624ff

File tree

5 files changed

+48
-21
lines changed

5 files changed

+48
-21
lines changed

Jenkinsfile

Lines changed: 34 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/jenkins/Deploy.groovy.j2

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ stage('Build packages') {
1818

1919

2020
def update_docker(ecr_image, hub_image) {
21+
if (ecr_image == null) {
22+
sh("image was not rebuilt, skipping")
23+
return
24+
}
2125
if (!ecr_image.contains("amazonaws.com")) {
22-
sh("echo Skipping '${ecr_image}' since it doesn't look like an ECR image")
26+
sh("echo \"Skipping '${ecr_image}' -> '${hub_image}' since it doesn\'t look like an ECR image\"")
2327
return
2428
}
2529
docker_init(ecr_image)
@@ -106,7 +110,7 @@ def deploy() {
106110
).trim()
107111
def tag = "${date_Ymd_HMS}-${upstream_revision.substring(0, 8)}"
108112
{% for image in images %}
109-
update_docker({{ image.name }}, "tlcpackstaging/{{ image.name }}:${tag}")
113+
update_docker(built_{{ image.name }}, "tlcpackstaging/{{ image.name }}:${tag}")
110114
{% endfor %}
111115
} finally {
112116
sh(

ci/jenkins/DockerBuild.groovy.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def build_docker_images() {
106106
// We're purposefully not setting the built image here since they
107107
// are not yet being uploaded to tlcpack
108108
// {{ image.name }} = build_image('{{ image.name }}')
109-
build_image('{{ image.name }}')
109+
built_{{ image.name }} = build_image('{{ image.name }}');
110110
}
111111
}
112112
},

ci/jenkins/Jenkinsfile.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ properties([
7272
])
7373
])
7474

75+
// Placeholders for newly built Docker image names (if rebuild_docker_images
76+
// is used)
77+
{% for image in images %}
78+
built_{{ image.name }} = null;
79+
{% endfor %}
80+
7581
// Global variable assigned during Sanity Check that holds the sha1 which should be
7682
// merged into the PR in all branches.
7783
upstream_revision = null

ci/jenkins/Prepare.groovy.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def prepare() {
180180
script: './tests/scripts/git_change_docker.sh',
181181
label: 'Check for any docker changes',
182182
)
183+
183184
if (skip_ci) {
184185
// Don't rebuild when skipping CI
185186
rebuild_docker_images = false

0 commit comments

Comments
 (0)