Skip to content

Commit

Permalink
ci: fix container image push order (#3116)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulguptajss authored Aug 21, 2024
1 parent da7b549 commit bf124b0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions jenkins/artifacts/jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -198,42 +198,42 @@ pipeline {
withDockerRegistry([credentialsId: "DockerHub", url: ""]) {
sh '''
docker login
docker push ${imageName}:$VERSION-$RELEASE
docker push ${imageName}:$VERSION-$RELEASE-fips
docker push ${imageName}:$VERSION-$RELEASE
'''
script {
if (OVERWRITE_DOCKER_LATEST_TAG == 'true') {
sh '''
docker push ${imageName}:latest
docker push ${imageName}:latest-fips
docker push ${imageName}:latest
'''
}
}
}
sh '''
echo $GIT_TOKEN | docker login ghcr.io -u $DOCKERHUB_USERNAME --password-stdin
docker push ${ghcrImage}:$VERSION-$RELEASE
docker push ${ghcrImage}:$VERSION-$RELEASE-fips
docker push ${ghcrImage}:$VERSION-$RELEASE
'''
script {
if (OVERWRITE_DOCKER_LATEST_TAG == 'true') {
sh '''
docker push ${ghcrImage}:latest
docker push ${ghcrImage}:latest-fips
docker push ${ghcrImage}:latest
'''
}
}
withCredentials([usernamePassword(credentialsId: 'Jfrog', passwordVariable: 'password', usernameVariable: 'username')]) {
sh '''
docker login --username=$username --password=$password ${jfrogRepo}
docker push ${jfrogImagePrefix}:$VERSION-$RELEASE
docker push ${jfrogImagePrefix}:$VERSION-$RELEASE-fips
docker push ${jfrogImagePrefix}:$VERSION-$RELEASE
'''
script {
if (OVERWRITE_DOCKER_LATEST_TAG == 'true') {
sh '''
docker push ${jfrogImagePrefix}:latest
docker push ${jfrogImagePrefix}:latest-fips
docker push ${jfrogImagePrefix}:latest
'''
}
}
Expand Down Expand Up @@ -268,8 +268,8 @@ pipeline {
docker build --secret id=git_token,src=${gitTokenFile} -f container/onePollerPerContainer/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg VERSION=$VERSION --build-arg RELEASE=$RELEASE --build-arg ASUP_MAKE_TARGET=$ASUP_MAKE_TARGET --build-arg FIPS=0 -t ${imageName}:latest -t ${imageName}:nightly -t ${jfrogImagePrefix}:latest -t ${jfrogImagePrefix}:nightly -t ${ghcrImage}:latest -t ${ghcrImage}:nightly . --no-cache
docker build --secret id=git_token,src=${gitTokenFile} -f container/onePollerPerContainer/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg VERSION=$VERSION --build-arg RELEASE=$RELEASE --build-arg ASUP_MAKE_TARGET=$ASUP_MAKE_TARGET --build-arg FIPS=1 -t ${imageName}:latest-fips -t ${imageName}:nightly-fips -t ${jfrogImagePrefix}:latest-fips -t ${jfrogImagePrefix}:nightly-fips -t ${ghcrImage}:latest-fips -t ${ghcrImage}:nightly-fips . --no-cache
echo $GIT_TOKEN | docker login ghcr.io -u $DOCKERHUB_USERNAME --password-stdin
docker push ${ghcrImage}:nightly
docker push ${ghcrImage}:nightly-fips
docker push ${ghcrImage}:nightly
# Add a dummy user/email for mike deploy to work
git config user.name harvest
git config user.email harvest
Expand All @@ -279,15 +279,15 @@ pipeline {
withDockerRegistry([credentialsId: "DockerHub", url: ""]) {
sh '''
docker login
docker push ${imageName}:nightly
docker push ${imageName}:nightly-fips
docker push ${imageName}:nightly
'''
}
withCredentials([usernamePassword(credentialsId: 'Jfrog', passwordVariable: 'password', usernameVariable: 'username')]) {
sh '''
docker login --username=$username --password=$password ${jfrogRepo}
docker push ${jfrogImagePrefix}:nightly
docker push ${jfrogImagePrefix}:nightly-fips
docker push ${jfrogImagePrefix}:nightly
'''
}
}
Expand Down

0 comments on commit bf124b0

Please sign in to comment.