github.com/lianghucheng/zrddz@v0.0.0-20200923083010-c71f680932e2/src/golang.org/x/net/http2/h2demo/Makefile (about)

     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  
     5  MUTABLE_VERSION ?= latest
     6  VERSION ?= $(shell git rev-parse --short HEAD)
     7  IMAGE_NAME=h2demo
     8  
     9  update-deps:
    10  	go install golang.org/x/build/cmd/gitlock
    11  	gitlock --update=Dockerfile --ignore=golang.org/x/net --tags=h2demo golang.org/x/net/http2/h2demo
    12  
    13  docker: Dockerfile
    14  	go install golang.org/x/build/cmd/xb
    15  	xb docker build -t golang/$(IMAGE_NAME) -f Dockerfile ../..
    16  
    17  push-staging: docker
    18  	go install golang.org/x/build/cmd/xb
    19  	xb --staging docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):$(VERSION)
    20  	xb --staging docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):latest
    21  	xb --staging docker push REPO/$(IMAGE_NAME):$(VERSION)
    22  	xb --staging docker push REPO/$(IMAGE_NAME):latest
    23  
    24  push-prod: docker
    25  	go install golang.org/x/build/cmd/xb
    26  	xb --prod docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):$(VERSION)
    27  	xb --prod docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):latest
    28  	xb --prod docker push REPO/$(IMAGE_NAME):$(VERSION)
    29  	xb --prod docker push REPO/$(IMAGE_NAME):latest
    30  
    31  # TODO(bradfitz): add REPO subsitution in xb for the kubectl command.
    32  deploy-prod: push-prod
    33  	xb --prod kubectl set image deployment/h2demo-deployment h2demo=gcr.io/symbolic-datum-552/h2demo:$(VERSION)
    34  deploy-staging: push-staging
    35  	xb --staging kubectl set image deployment/h2demo-deployment h2demo=gcr.io/go-dashboard-dev/h2demo:$(VERSION)
    36  
    37  FORCE: