Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright 2018 The Go Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style
  3. # license that can be found in the LICENSE file.
  4. MUTABLE_VERSION ?= latest
  5. VERSION ?= $(shell git rev-parse --short HEAD)
  6. IMAGE_NAME=h2demo
  7. update-deps:
  8. go install golang.org/x/build/cmd/gitlock
  9. gitlock --update=Dockerfile --ignore=golang.org/x/net --tags=h2demo golang.org/x/net/http2/h2demo
  10. docker: Dockerfile
  11. go install golang.org/x/build/cmd/xb
  12. xb docker build -t golang/$(IMAGE_NAME) -f Dockerfile ../..
  13. push-staging: docker
  14. go install golang.org/x/build/cmd/xb
  15. xb --staging docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):$(VERSION)
  16. xb --staging docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):latest
  17. xb --staging docker push REPO/$(IMAGE_NAME):$(VERSION)
  18. xb --staging docker push REPO/$(IMAGE_NAME):latest
  19. push-prod: docker
  20. go install golang.org/x/build/cmd/xb
  21. xb --prod docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):$(VERSION)
  22. xb --prod docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):latest
  23. xb --prod docker push REPO/$(IMAGE_NAME):$(VERSION)
  24. xb --prod docker push REPO/$(IMAGE_NAME):latest
  25. # TODO(bradfitz): add REPO subsitution in xb for the kubectl command.
  26. deploy-prod: push-prod
  27. xb --prod kubectl set image deployment/h2demo-deployment h2demo=gcr.io/symbolic-datum-552/h2demo:$(VERSION)
  28. deploy-staging: push-staging
  29. xb --staging kubectl set image deployment/h2demo-deployment h2demo=gcr.io/go-dashboard-dev/h2demo:$(VERSION)
  30. FORCE: