2017-06-20 22:20:22 +03:00
|
|
|
# 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.
|
|
|
|
|
2017-09-05 23:47:00 +03:00
|
|
|
MUTABLE_VERSION ?= latest
|
|
|
|
VERSION ?= $(shell git rev-parse --short HEAD)
|
|
|
|
|
|
|
|
IMAGE_STAGING := gcr.io/go-dashboard-dev/devapp
|
|
|
|
IMAGE_PROD := gcr.io/symbolic-datum-552/devapp
|
2017-07-15 02:50:19 +03:00
|
|
|
|
2018-04-13 22:53:01 +03:00
|
|
|
docker-prod: Dockerfile
|
|
|
|
docker build --force-rm -f Dockerfile --tag=$(IMAGE_PROD):$(VERSION) ../
|
2017-09-05 23:47:00 +03:00
|
|
|
docker tag $(IMAGE_PROD):$(VERSION) $(IMAGE_PROD):$(MUTABLE_VERSION)
|
2018-04-13 22:53:01 +03:00
|
|
|
docker-staging: Dockerfile
|
|
|
|
docker build --force-rm -f Dockerfile --tag=$(IMAGE_STAGING):$(VERSION) ../
|
2017-09-05 23:47:00 +03:00
|
|
|
docker tag $(IMAGE_STAGING):$(VERSION) $(IMAGE_STAGING):$(MUTABLE_VERSION)
|
2017-06-20 22:20:22 +03:00
|
|
|
|
|
|
|
push-prod: docker-prod
|
2018-04-21 00:08:19 +03:00
|
|
|
docker push $(IMAGE_PROD):$(VERSION)
|
2021-09-08 22:01:07 +03:00
|
|
|
docker push $(IMAGE_PROD):$(MUTABLE_VERSION)
|
2017-07-26 22:13:34 +03:00
|
|
|
push-staging: docker-staging
|
2018-04-21 00:08:19 +03:00
|
|
|
docker push $(IMAGE_STAGING):$(VERSION)
|
2021-09-08 22:01:07 +03:00
|
|
|
docker push $(IMAGE_STAGING):$(MUTABLE_VERSION)
|
2017-06-20 22:20:22 +03:00
|
|
|
|
2017-07-26 22:13:34 +03:00
|
|
|
deploy-prod: push-prod
|
2018-05-08 04:20:13 +03:00
|
|
|
go install golang.org/x/build/cmd/xb
|
2021-09-08 21:28:14 +03:00
|
|
|
xb --prod kubectl --namespace prod set image deployment/devapp-deployment devapp=$(IMAGE_PROD):$(VERSION)
|
2017-07-26 22:13:34 +03:00
|
|
|
deploy-staging: push-staging
|
2018-05-08 04:20:13 +03:00
|
|
|
go install golang.org/x/build/cmd/xb
|
|
|
|
xb --staging kubectl set image deployment/devapp-deployment devapp=$(IMAGE_STAGING):$(VERSION)
|