devapp: assign image version based on git rev

Change-Id: Icf7c33dcda731d3641da3a72ebd56f39e05f0813
Reviewed-on: https://go-review.googlesource.com/47835
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Andrew Bonventre 2017-07-14 16:50:19 -07:00
Родитель 0f092dac24
Коммит 040116b11c
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -2,7 +2,13 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
VERSION=latest
# Set dirty suffix depending on output of "git status".
DIRTY = ""
ifneq ($(shell git status --porcelain -- .),)
DIRTY = "-tainted"
endif
VERSION ?= `git show --format='%h' --no-patch`$(DIRTY)
DOCKER_IMAGE_build0=build0/devapp:latest
DOCKER_CTR_build0=devapp-build0
@ -26,12 +32,12 @@ update-deps:
docker-prod: Dockerfile devapp ca-certificates.crt
docker build --force-rm --tag=gcr.io/symbolic-datum-552/devapp:$(VERSION) .
docker-dev: Dockerfile devapp ca-certificates.crt
docker build --force-rm --tag=gcr.io/go-dashboard-dev/devapp:latest .
docker build --force-rm --tag=gcr.io/go-dashboard-dev/devapp:$(VERSION) .
push-prod: docker-prod
gcloud docker -- push gcr.io/symbolic-datum-552/devapp:$(VERSION)
push-dev: docker-dev
gcloud docker -- push gcr.io/go-dashboard-dev/devapp:latest
gcloud docker -- push gcr.io/go-dashboard-dev/devapp:$(VERSION)
.PHONY: clean
clean: