Skip to content

Commit

Permalink
Merge pull request #968 from eyalbe4/fix-cli-image-pub
Browse files Browse the repository at this point in the history
Fix jfrog-cli's docker image publication issue
  • Loading branch information
eyalbe4 authored Feb 3, 2021
2 parents 535e179 + 4b7de96 commit ba79058
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,17 @@ def uploadCli(architectures) {
}
}

def buildPublishDockerImage(version, jfrogCliRepoDir) {
def buildPublishDockerImage(version, jfrogCliRepoDir) {
dir("$jfrogCliRepoDir") {
withCredentials([usernamePassword(credentialsId: 'bintray-key-eco', usernameVariable: 'USER_NAME', passwordVariable: 'KEY')]) {
docker.build("jfrog-docker-reg2.bintray.io/jfrog/jfrog-cli-go:$version")
sh '#!/bin/sh -e\n' + 'echo $KEY | docker login --username=$USER_NAME --password-stdin jfrog-docker-reg2.bintray.io/jfrog'
sh "docker push jfrog-docker-reg2.bintray.io/jfrog/jfrog-cli-go:$version"
sh "docker tag jfrog-docker-reg2.bintray.io/jfrog/jfrog-cli-go:$version jfrog-docker-reg2.bintray.io/jfrog/jfrog-cli-go:latest"
sh "docker push jfrog-docker-reg2.bintray.io/jfrog/jfrog-cli-go:latest"
}
docker.build("releases-docker.jfrog.io/jfrog/jfrog-cli-go:$version")
}
withCredentials([string(credentialsId: 'jfrog-cli-automation', variable: 'JFROG_CLI_AUTOMATION_ACCESS_TOKEN')]) {
options = "--url https://releases.jfrog.io/artifactory --access-token=$JFROG_CLI_AUTOMATION_ACCESS_TOKEN"
sh """#!/bin/bash
builder/jfrog rt docker-push releases-docker.jfrog.io/jfrog/jfrog-cli-go:$version reg2 $options
docker tag releases-docker.jfrog.io/jfrog/jfrog-cli-go:$version releases-docker.jfrog.io/jfrog/jfrog-cli-go:latest
builder/jfrog rt docker-push releases-docker.jfrog.io/jfrog/jfrog-cli-go:latest reg2 $options
"""
}
}

Expand Down

0 comments on commit ba79058

Please sign in to comment.