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 5109274 commit 980054b
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pipeline {
steps {
timeout(time: 30, unit: 'MINUTES') {
script {
createFile("/tmp/.config/google-cloud-tools-java/jib", "config.json")
sh "mkdir -p /tmp/.config/google-cloud-tools-java/jib && touch /tmp/.config/google-cloud-tools-java/jib/config.json", returnStatus: false
def gitCommitHash = env.GIT_COMMIT
def imageTags = isMasterBranch() || isReleaseBranch() ? "${versionText},${gitCommitHash}" : "${gitCommitHash}"
withDockerCredentials(DOCKERHUB_CREDS, "FROM_") {
Expand Down Expand Up @@ -203,7 +203,7 @@ pipeline {
steps {
timeout(time: 30, unit: 'MINUTES') {
script {
createFile("/tmp/.config/google-cloud-tools-java/jib", "config.json")
sh "mkdir -p /tmp/.config/google-cloud-tools-java/jib && touch /tmp/.config/google-cloud-tools-java/jib/config.json", returnStatus: false
def gitCommitHash = env.GIT_COMMIT
def imageTags = isMasterBranch() || isReleaseBranch() ? "${versionText},${gitCommitHash}" : "${gitCommitHash}"
withDockerCredentials(DOCKERHUB_CREDS, "FROM_") {
Expand Down Expand Up @@ -239,7 +239,7 @@ pipeline {
steps {
timeout(time: 30, unit: 'MINUTES') {
script {
createFile("/tmp/.config/google-cloud-tools-java/jib", "config.json")
sh "mkdir -p /tmp/.config/google-cloud-tools-java/jib && touch /tmp/.config/google-cloud-tools-java/jib/config.json", returnStatus: false
def gitCommitHash = env.GIT_COMMIT
def imageTags = isMasterBranch() || isReleaseBranch() ? "${versionText},${gitCommitHash}" : "${gitCommitHash}"
withDockerCredentials(DOCKERHUB_CREDS, "FROM_") {
Expand Down Expand Up @@ -322,15 +322,3 @@ void withGCRCredentials(final String credentialsId, final Closure body) {
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 980054b

Please sign in to comment.