Skip to content

Commit 949e6c8

Browse files
Merge pull request #36 from memphisdev/valeraBr-patch-1
Update Jenkinsfile
2 parents 5b67bfd + 19f3da2 commit 949e6c8

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Jenkinsfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff 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)/) {

0 commit comments

Comments
 (0)