File: Makefile

package info (click to toggle)
golang-golang-x-net 1%3A0.0%2Bgit20210119.5f4716e%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 7,164 kB
  • sloc: makefile: 39; asm: 23
file content (33 lines) | stat: -rw-r--r-- 1,334 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Copyright 2018 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.

MUTABLE_VERSION ?= latest
VERSION ?= $(shell git rev-parse --short HEAD)
IMAGE_NAME=h2demo

docker: Dockerfile
	go install golang.org/x/build/cmd/xb
	xb docker build -t golang/$(IMAGE_NAME) -f Dockerfile ../..

push-staging: docker
	go install golang.org/x/build/cmd/xb
	xb --staging docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):$(VERSION)
	xb --staging docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):latest
	xb --staging docker push REPO/$(IMAGE_NAME):$(VERSION)
	xb --staging docker push REPO/$(IMAGE_NAME):latest

push-prod: docker
	go install golang.org/x/build/cmd/xb
	xb --prod docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):$(VERSION)
	xb --prod docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):latest
	xb --prod docker push REPO/$(IMAGE_NAME):$(VERSION)
	xb --prod docker push REPO/$(IMAGE_NAME):latest

# TODO(bradfitz): add REPO subsitution in xb for the kubectl command.
deploy-prod: push-prod
	xb --prod kubectl set image deployment/h2demo-deployment h2demo=gcr.io/symbolic-datum-552/h2demo:$(VERSION)
deploy-staging: push-staging
	xb --staging kubectl set image deployment/h2demo-deployment h2demo=gcr.io/go-dashboard-dev/h2demo:$(VERSION)

FORCE: