Skip to content

Commit c5600cc

Browse files
driazatiYour Name
authored andcommitted
[ci][docker] Tag tlcpackstaging images to tlcpack
See #11768, this PR changes the deploy workflow so that after a successful build with fallback images (see #11775), they get moved over to tlcpack automatically
1 parent 195e60b commit c5600cc

File tree

2 files changed

+156
-1
lines changed

2 files changed

+156
-1
lines changed

Jenkinsfile

Lines changed: 123 additions & 1 deletion
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: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,39 @@ def deploy() {
8686
}
8787
}
8888
}
89+
if (env.BRANCH_NAME == 'main' && env.RETAG_STAGING_IMAGES == 'yes') {
90+
withCredentials([string(
91+
credentialsId: 'dockerhub-tlcpack-key',
92+
variable: 'TLCPACK_TOKEN',
93+
)]) {
94+
try {
95+
sh(
96+
script: 'echo $TLCPACK_TOKEN | docker login --username octomldriazati --password-stdin',
97+
label: 'Log in to Docker Hub'
98+
)
99+
{% for image in images %}
100+
if ({{ image.name }}.contains("tlcpackstaging")) {
101+
// Push image to tlcpack
102+
def tag = {{ image.name }}.split(":")[1]
103+
sh(
104+
script: """
105+
set -eux
106+
docker pull tlcpackstaging/{{ image.name }}:${tag}
107+
docker tag tlcpackstaging/{{ image.name }}:${tag} tlcpack/{{ image.name.replace("_", "-") }}:${tag}
108+
docker push tlcpack/{{ image.name.replace("_", "-") }}:${tag}
109+
""",
110+
label: 'Tag tlcpackstaging/{{ image.name }} image to tlcpack',
111+
)
112+
}
113+
{% endfor %}
114+
} finally {
115+
sh(
116+
script: 'docker logout',
117+
label: 'Clean up login credentials'
118+
)
119+
}
120+
}
121+
}
89122
if (env.BRANCH_NAME == 'main' && env.DEPLOY_DOCKER_IMAGES == 'yes' && rebuild_docker_images && upstream_revision != null) {
90123
node('CPU') {
91124
ws({{ m.per_exec_ws('tvm/deploy-docker') }}) {

0 commit comments

Comments
 (0)