-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/gomoteserver: add Makefile and associated cloud build config
This change adds the last required configuration files required for building the gomote server. Updates golang/go#61912 For golang/go#61772 Change-Id: I625a4d265260eb95f1a37de8c5b3596b1c2fd7c8 Reviewed-on: https://go-review.googlesource.com/c/build/+/520655 Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Carlos Amedee <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Run-TryBot: Carlos Amedee <[email protected]>
- Loading branch information
1 parent
1e72cea
commit bf0edf0
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2023 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. | ||
|
||
usage: FORCE | ||
exit 1 | ||
|
||
FORCE: | ||
|
||
MUTABLE_VERSION := latest | ||
VERSION := $(shell ./version.sh) # TODO(go.dev/issue/62118) change how version is generated. | ||
|
||
GCP_PROJECT_PROD := symbolic-datum-552 | ||
IMAGE_PROD := gcr.io/$(GCP_PROJECT_PROD)/gomoteserver | ||
|
||
DOCKER_IMAGE=golang/gomoteserver | ||
|
||
docker: *.go Dockerfile | ||
docker build --force-rm -f Dockerfile --build-arg "version=$(VERSION)" --tag=$(DOCKER_IMAGE):$(VERSION) ../.. | ||
|
||
push-prod: | ||
gcloud builds submit --project $(GCP_PROJECT_PROD) --config ./cloudbuild.yaml --substitutions=TAG_NAME="$(VERSION)" ../../ | ||
|
||
deploy-prod: push-prod | ||
go install golang.org/x/build/cmd/xb | ||
xb --prod kubectl --namespace prod set image deployment/gomoteserver-deployment gomoteserver=$(IMAGE_PROD):$(VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright 2023 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. | ||
|
||
steps: | ||
- name: 'gcr.io/cloud-builders/docker' | ||
args: | ||
- 'build' | ||
- '-f' | ||
- 'cmd/gomoteserver/Dockerfile' | ||
- '--build-arg' | ||
- 'version=${TAG_NAME}' | ||
- '-t' | ||
- 'gcr.io/symbolic-datum-552/gomoteserver:${TAG_NAME}' | ||
- '-t' | ||
- 'gcr.io/symbolic-datum-552/gomoteserver:latest' | ||
- '.' | ||
- name: 'gcr.io/cloud-builders/docker' | ||
args: ['push', 'gcr.io/symbolic-datum-552/gomoteserver:${TAG_NAME}'] | ||
images: | ||
- 'gcr.io/symbolic-datum-552/gomoteserver:${TAG_NAME}' | ||
- 'gcr.io/symbolic-datum-552/gomoteserver:latest' | ||
options: | ||
logging: CLOUD_LOGGING_ONLY |