Skip to content

Commit

Permalink
cmd/gomoteserver: add Makefile and associated cloud build config
Browse files Browse the repository at this point in the history
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
cagedmantis authored and gopherbot committed Aug 17, 2023
1 parent 1e72cea commit bf0edf0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cmd/gomoteserver/Makefile
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)
24 changes: 24 additions & 0 deletions cmd/gomoteserver/cloudbuild.yaml
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

0 comments on commit bf0edf0

Please sign in to comment.