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/27 23:34:35 UTC
[tvm] 27/34: 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 f262a487dfec407925c347a3c6b3419679c5a32d
Author: Andrew Reusch <ar...@gmail.com>
AuthorDate: Mon Jun 13 16:39:17 2022 -0700
sanitize image name
---
Jenkinsfile | 9 +++++++--
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/jenkins/DockerBuild.groovy.j2 b/jenkins/DockerBuild.groovy.j2
index a0ff666773..80ee66a6ae 100644
--- a/jenkins/DockerBuild.groovy.j2
+++ b/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'