From 510927420c7e43ef8a3a39b3be23224eb5c1bd3f Mon Sep 17 00:00:00 2001 From: jackjii79 Date: Wed, 21 Feb 2024 21:14:14 -0800 Subject: [PATCH] fix --- Jenkinsfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 31d13efb..ffcf056e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,6 +3,7 @@ @Library('test-shared-library@1.19') _ import ai.h2o.ci.Utils +import java.io.File JAVA_IMAGE = 'harbor.h2o.ai/dockerhub-proxy/library/openjdk:17-jdk-slim' NODE_LABEL = 'docker' @@ -165,6 +166,7 @@ pipeline { steps { timeout(time: 30, unit: 'MINUTES') { script { + createFile("/tmp/.config/google-cloud-tools-java/jib", "config.json") def gitCommitHash = env.GIT_COMMIT def imageTags = isMasterBranch() || isReleaseBranch() ? "${versionText},${gitCommitHash}" : "${gitCommitHash}" withDockerCredentials(DOCKERHUB_CREDS, "FROM_") { @@ -201,6 +203,7 @@ pipeline { steps { timeout(time: 30, unit: 'MINUTES') { script { + createFile("/tmp/.config/google-cloud-tools-java/jib", "config.json") def gitCommitHash = env.GIT_COMMIT def imageTags = isMasterBranch() || isReleaseBranch() ? "${versionText},${gitCommitHash}" : "${gitCommitHash}" withDockerCredentials(DOCKERHUB_CREDS, "FROM_") { @@ -236,6 +239,7 @@ pipeline { steps { timeout(time: 30, unit: 'MINUTES') { script { + createFile("/tmp/.config/google-cloud-tools-java/jib", "config.json") def gitCommitHash = env.GIT_COMMIT def imageTags = isMasterBranch() || isReleaseBranch() ? "${versionText},${gitCommitHash}" : "${gitCommitHash}" withDockerCredentials(DOCKERHUB_CREDS, "FROM_") { @@ -319,3 +323,14 @@ void withGCRCredentials(final String credentialsId, final Closure body) { } } +void createFile(String dir, String filename) { + File path = new File(dir) + if (!path.exists()) { + path.mkdirs() + } + File file = new File(path, filename) + if (!file.exists()) { + file.createNewFile() + } +} +