blob: 1c67b5bc917cfd0b36dc3c1ea42ddbf4f4085e3f [file] [log] [blame]
# Copyright 2017 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
VERSION=v2
DOCKER_IMAGE_STAGE0=stage0/pubsubhelper:latest
DOCKER_CTR_STAGE0=pubsubhelper-stage0
stage0: *.go Dockerfile.0
docker build --force-rm -f Dockerfile.0 --tag=$(DOCKER_IMAGE_STAGE0) ../..
pubsubhelper: stage0
docker create --name $(DOCKER_CTR_STAGE0) $(DOCKER_IMAGE_STAGE0)
docker cp $(DOCKER_CTR_STAGE0):/go/bin/$@ $@
docker rm $(DOCKER_CTR_STAGE0)
ca-certificates.crt:
docker create --name $(DOCKER_CTR_STAGE0) $(DOCKER_IMAGE_STAGE0)
docker cp $(DOCKER_CTR_STAGE0):/etc/ssl/certs/$@ $@
docker rm $(DOCKER_CTR_STAGE0)
docker-prod: Dockerfile pubsubhelper ca-certificates.crt
docker build --force-rm --tag=gcr.io/symbolic-datum-552/pubsubhelper:$(VERSION) .
docker-dev: Dockerfile pubsubhelper ca-certificates.crt
docker build --force-rm --tag=gcr.io/go-dashboard-dev/pubsubhelper:latest .
push-prod: docker-prod
gcloud docker -- push gcr.io/symbolic-datum-552/pubsubhelper:$(VERSION)
push-dev: docker-dev
gcloud docker -- push gcr.io/go-dashboard-dev/pubsubhelper:latest
.PHONY: clean
clean:
$(RM) pubsubhelper
$(RM) ca-certificates.crt