Skip to content

Commit a3f88d5

Browse files
authored
Tag and publish latest if tag is on the main branch (#199)
Signed-off-by: Pavol Loffay <[email protected]>
1 parent ae53a3d commit a3f88d5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ muzzle:
2222
.PHONY: docker
2323
docker: assemble
2424
docker build -f javaagent/Dockerfile javaagent/ -t ${DOCKER_IMAGE}:${DOCKER_TAG}
25+
# use also 'latest' tag if the tag is on the main branch
26+
@git branch -a --contains ${DOCKER_TAG} | grep main && docker tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:latest || echo "skipping latest; not on the main branch"
2527

2628
.PHONY: docker-push
2729
docker-push:
2830
docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
31+
@git branch -a --contains ${DOCKER_TAG} | grep main && docker push ${DOCKER_IMAGE}:latest || echo "skipping latest; not on the main branch"
2932

3033
.PHONY: test
3134
test:

0 commit comments

Comments
 (0)