Skip to content

Commit

Permalink
add labels with git commit and author for docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
adambabik authored and dshulyak committed Sep 10, 2018
1 parent c865d89 commit 842d15d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ deps:
test:
go test ./...

image: AUTHOR = $(shell echo $$USER)
image: GIT_COMMIT = $(shell tag=`git describe --exact-match --tag 2>/dev/null`; \
if [ $$? -eq 0 ]; then echo $$tag | sed 's/^v\(.*\)$$/\1/'; \
else git rev-parse --short HEAD; fi)
image:
docker build . -t statusteam/rendezvous:latest
docker build . \
--label "commit=$(GIT_COMMIT)" \
--label "author=$(AUTHOR)" \
-t statusteam/rendezvous:$(GIT_COMMIT)
-t statusteam/rendezvous:latest

push:
docker push statusteam/rendezvous:latest

0 comments on commit 842d15d

Please sign in to comment.