From bf124b0bd141f21e06b3f8c6b12ab9c6818c9c71 Mon Sep 17 00:00:00 2001 From: Rahul Date: Wed, 21 Aug 2024 21:42:45 +0530 Subject: [PATCH] ci: fix container image push order (#3116) --- jenkins/artifacts/jenkinsfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/jenkins/artifacts/jenkinsfile b/jenkins/artifacts/jenkinsfile index 640b37fc4..50c50aff3 100644 --- a/jenkins/artifacts/jenkinsfile +++ b/jenkins/artifacts/jenkinsfile @@ -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 ''' } } @@ -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 @@ -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 ''' } }