Skip to content

Commit

Permalink
[ci][docker] Tag tlcpackstaging images to tlcpack
Browse files Browse the repository at this point in the history
See apache#11768, this PR changes the deploy workflow so that after a successful build with fallback images (see apache#11775), they get moved over to tlcpack automatically
  • Loading branch information
driazati committed Jun 23, 2022
1 parent 6660e27 commit cd44283
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 1 deletion.
113 changes: 112 additions & 1 deletion Jenkinsfile

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

22 changes: 22 additions & 0 deletions jenkins/Deploy.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,28 @@ def deploy() {
}
}
}
if (env.BRANCH_NAME == 'main' && env.RETAG_STAGING_IMAGES == 'yes') {
withCredentials([string(
credentialsId: 'dockerhub-tlcpack-key',
variable: 'TLCPACK_TOKEN',
)]) {
{% for image in images %}
if ({{ image.name }}.contains("tlcpackstaging")) {
// Push image to tlcpack
def tag = {{ image.name }}.split(":")[1]
sh(
script: """
set -eux
CONTENT_TYPE="application/vnd.docker.distribution.manifest.v2+json"
MANIFEST=\$(curl -H "Accept: \${CONTENT_TYPE}" "https://hub.docker.com/v2/tlcpackstaging/{{ image.name }}/manifests/${tag}")
curl -X PUT -H "Authorization: Bearer \${TLCPACK_TOKEN}" -H "Content-Type: \${CONTENT_TYPE}" -d "\${MANIFEST}" "https://hub.docker.com/v2/tlcpack/{{ image.name.replace("_", "-") }}/manifests/${tag}"
""",
label: 'Tag tlcpackstaging image to tlcpack',
)
}
{% endfor %}
}
}
if (env.BRANCH_NAME == 'main' && env.DEPLOY_DOCKER_IMAGES == 'yes' && rebuild_docker_images && upstream_revision != null) {
node('CPU') {
ws({{ m.per_exec_ws('tvm/deploy-docker') }}) {
Expand Down

0 comments on commit cd44283

Please sign in to comment.