Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jackjii79 committed Feb 22, 2024
1 parent 37dfa2f commit 5109274
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@Library('[email protected]') _

import ai.h2o.ci.Utils
import java.io.File

JAVA_IMAGE = 'harbor.h2o.ai/dockerhub-proxy/library/openjdk:17-jdk-slim'
NODE_LABEL = 'docker'
Expand Down Expand Up @@ -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_") {
Expand Down Expand Up @@ -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_") {
Expand Down Expand Up @@ -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_") {
Expand Down Expand Up @@ -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()
}
}

0 comments on commit 5109274

Please sign in to comment.