You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ar...@apache.org on 2022/06/30 23:10:33 UTC

[tvm] 27/42: sanitize image name

This is an automated email from the ASF dual-hosted git repository.

areusch pushed a commit to branch areusch/freeze-dependencies
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 6fa6dbb56cc40fd8c5c4879363b92a7999fd26e9
Author: Andrew Reusch <ar...@gmail.com>
AuthorDate: Mon Jun 13 16:39:17 2022 -0700

    sanitize image name
---
 Jenkinsfile                      | 9 +++++++--
 ci/jenkins/DockerBuild.groovy.j2 | 7 ++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index a288084ef1..efc7560f8f 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-06-10T14:21:31.300009
+// Generated at 2022-06-13T16:39:11.598304
 
 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
 // NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
@@ -432,7 +432,12 @@ def build_image(image_name) {
     returnStdout: true,
     script: 'git log -1 --format=\'%h\''
   ).trim()
-  def full_name = "${image_name}:${env.BRANCH_NAME}-${hash}-${env.BUILD_NUMBER}"
+  def image_rev = sh(
+    script: "docker/sanitize-docker-image-name.sh ${env.BRANCH_NAME}-${hash}-${env.BUILD_NUMBER}",
+    label: "Sanitize image name",
+    returnStdout: true
+  )
+  def full_name = "${image_name}:${image_rev}"
   sh(
     script: "${docker_build} ${image_name} --spec ${full_name}",
     label: 'Build docker image'
diff --git a/ci/jenkins/DockerBuild.groovy.j2 b/ci/jenkins/DockerBuild.groovy.j2
index a0ff666773..80ee66a6ae 100644
--- a/ci/jenkins/DockerBuild.groovy.j2
+++ b/ci/jenkins/DockerBuild.groovy.j2
@@ -86,7 +86,12 @@ def build_image(image_name) {
     returnStdout: true,
     script: 'git log -1 --format=\'%h\''
   ).trim()
-  def full_name = "${image_name}:${env.BRANCH_NAME}-${hash}-${env.BUILD_NUMBER}"
+  def image_rev = sh(
+    script: "docker/sanitize-docker-image-name.sh ${env.BRANCH_NAME}-${hash}-${env.BUILD_NUMBER}",
+    label: "Sanitize image name",
+    returnStdout: true
+  )
+  def full_name = "${image_name}:${image_rev}"
   sh(
     script: "${docker_build} ${image_name} --spec ${full_name}",
     label: 'Build docker image'