Skip to content

Commit 74971a5

Browse files
authored
add git commit hash as docker tag (#47)
In addition to the main, pr and release tags, add the git short hash as an image tag for maximum stability (particularly of main commits)
1 parent 21e1c87 commit 74971a5

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
@@ -38,8 +38,11 @@ rendersvc.image: python
3838
cd components/python/rendersvc && docker build $(DOCKER_BUILD_OPTS) -t $(REPO)/rendersvc:$(VTAG) -f docker/Dockerfile .
3939

4040
PUSH_TARGETS=$(addsuffix .push,$(IMAGE_COMPONENTS)) keystone.push dashboard.push dashboard-build.push web.push graphql.push rendersvc.push
41+
HASHTAG=$(shell git rev-parse --short=7 HEAD)
4142
%.push: %.image
43+
docker tag $(REPO)/$(subst .push,,$@):$(VTAG) $(REPO)/$(subst .push,,$@):$(HASHTAG)
4244
docker push $(REPO)/$(subst .push,,$@):$(VTAG)
45+
docker push $(REPO)/$(subst .push,,$@):$(HASHTAG)
4346

4447
images: $(IMAGE_TARGETS)
4548

0 commit comments

Comments
 (0)