File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,17 @@ node {
1515 }
1616 }
1717
18-
19- stage(' Build and push image to Docker Hub' ) {
20- sh " docker buildx use builder"
21- sh " docker buildx build --push --tag ${ repoUrlPrefix} /${ imageName} :${ gitBranch} --platform linux/amd64,linux/arm64 ."
18+ if (env. BRANCH_NAME ==~ / (latest)/ ) {
19+ stage(' Build and push image to Docker Hub' ) {
20+ sh " docker buildx use builder"
21+ sh " docker buildx build --push --tag ${ repoUrlPrefix} /${ imageName} :${ gitBranch} --tag ${ repoUrlPrefix} /${ imageName} :${ versionTag} --platform linux/amd64,linux/arm64 ."
22+ }
23+ }
24+ else {
25+ stage(' Build and push image to Docker Hub' ) {
26+ sh " docker buildx use builder"
27+ sh " docker buildx build --push --tag ${ repoUrlPrefix} /${ imageName} :${ gitBranch} --platform linux/amd64,linux/arm64 ."
28+ }
2229 }
2330
2431 if (env. BRANCH_NAME ==~ / (latest)/ ) {
You can’t perform that action at this time.
0 commit comments