From 6ea5b50f268052317c9a0056596fd0b90c0be507 Mon Sep 17 00:00:00 2001 From: driazati Date: Mon, 26 Sep 2022 10:48:11 -0700 Subject: [PATCH] [ci] Initialize git during deploys We rely on some utilities scripts in the deploy steps so they also need a git checkout. Fixes issues like https://ci.tlcpack.ai/blue/organizations/jenkins/tvm/detail/main/4345/pipeline --- Jenkinsfile | 14 ++++++++------ ci/jenkins/Deploy.groovy.j2 | 10 ++++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a61ab1cd69a2..e5be4a864b58 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,7 @@ // 'python3 jenkins/generate.py' // Note: This timestamp is here to ensure that updates to the Jenkinsfile are // always rebased on main before merging: -// Generated at 2022-09-16T08:47:49.743918 +// Generated at 2022-09-26T10:48:49.577077 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils // NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. --> @@ -4246,7 +4246,8 @@ def deploy() { node('CPU') { ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/deploy-docker") { timeout(time: max_time, unit: 'MINUTES') { - try { + init_git() + try { withCredentials([string( credentialsId: 'dockerhub-tlcpackstaging-key', variable: 'DOCKERHUB_KEY', @@ -4290,10 +4291,11 @@ def deploy() { node('CPU') { ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/tag-images") { timeout(time: max_time, unit: 'MINUTES') { - withCredentials([string( - credentialsId: 'dockerhub-tlcpack-key', - variable: 'TLCPACK_TOKEN', - )]) { + init_git() + withCredentials([string( + credentialsId: 'dockerhub-tlcpack-key', + variable: 'TLCPACK_TOKEN', + )]) { try { sh( script: 'echo $TLCPACK_TOKEN | docker login --username octomldriazati --password-stdin', diff --git a/ci/jenkins/Deploy.groovy.j2 b/ci/jenkins/Deploy.groovy.j2 index 9812e1113598..798af6736e1e 100644 --- a/ci/jenkins/Deploy.groovy.j2 +++ b/ci/jenkins/Deploy.groovy.j2 @@ -99,6 +99,7 @@ def deploy() { feature_flag="env.DEPLOY_DOCKER_IMAGES == 'yes' && rebuild_docker_images && upstream_revision != null", ws="tvm/deploy-docker", ) %} + init_git() try { withCredentials([string( credentialsId: 'dockerhub-tlcpackstaging-key', @@ -130,10 +131,11 @@ def deploy() { feature_flag="env.DOCS_DEPLOY_ENABLED == 'yes'", ws="tvm/tag-images", ) %} - withCredentials([string( - credentialsId: 'dockerhub-tlcpack-key', - variable: 'TLCPACK_TOKEN', - )]) { + init_git() + withCredentials([string( + credentialsId: 'dockerhub-tlcpack-key', + variable: 'TLCPACK_TOKEN', + )]) { try { sh( script: 'echo $TLCPACK_TOKEN | docker login --username octomldriazati --password-stdin',