golang.org/x/build@v0.0.0-20240506185731-218518f32b70/cmd/coordinator/Makefile (about)

     1  # Copyright 2017 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  usage: FORCE
     6  	# See Makefile targets.
     7  	exit 1
     8  
     9  FORCE:
    10  
    11  MUTABLE_VERSION := latest
    12  VERSION := $(shell ./version.sh)
    13  
    14  GCP_PROJECT_PROD := symbolic-datum-552
    15  IMAGE_STAGING := gcr.io/go-dashboard-dev/coordinator
    16  IMAGE_PROD := gcr.io/$(GCP_PROJECT_PROD)/coordinator
    17  
    18  DOCKER_IMAGE=golang/coordinator
    19  
    20  docker: *.go Dockerfile
    21  	docker build --force-rm -f Dockerfile --build-arg "version=$(VERSION)" --tag=$(DOCKER_IMAGE):$(VERSION) ../..
    22  
    23  docker-staging: docker
    24  	docker tag $(DOCKER_IMAGE):$(VERSION) $(IMAGE_STAGING):$(VERSION)
    25  	docker tag $(DOCKER_IMAGE):$(VERSION) $(IMAGE_STAGING):$(MUTABLE_VERSION)
    26  
    27  push-prod:
    28  	gcloud builds submit --project $(GCP_PROJECT_PROD) --config ./cloudbuild.yaml --substitutions=TAG_NAME="$(VERSION)" ../../
    29  
    30  push-staging: docker-staging
    31  	docker push $(IMAGE_STAGING):$(VERSION)
    32  	docker push $(IMAGE_STAGING):$(MUTABLE_VERSION)
    33  
    34  deploy-prod: push-prod
    35  	go install golang.org/x/build/cmd/xb
    36  	xb --prod kubectl --namespace prod set image deployment/coordinator-deployment coordinator=$(IMAGE_PROD):$(VERSION)
    37  deploy-staging: push-staging
    38  	go install golang.org/x/build/cmd/xb
    39  	xb --staging kubectl set image deployment/coordinator-deployment coordinator=$(IMAGE_STAGING):$(VERSION)