From df4215d43149d8080b96bb36fdae4dd635432063 Mon Sep 17 00:00:00 2001 From: Jonathan Amsterdam Date: Wed, 15 Apr 2020 10:38:29 -0400 Subject: [PATCH] cloudbuild.yaml: let Google Cloud Build run our CI script This can be done with gcloud builds submit or by hooking up a CI system. Change-Id: I07b1967ffd239aab1ed8a7c7993739f3017be490 Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/718641 CI-Result: Cloud Build Reviewed-by: Julie Qiu --- cloudbuild.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 cloudbuild.yaml diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 00000000..797b4a4e --- /dev/null +++ b/cloudbuild.yaml @@ -0,0 +1,28 @@ +# Copyright 2020 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: + +# Run postgres in a docker container to host the test database. +- name: 'gcr.io/cloud-builders/docker' + args: ['run', '--rm', '-d', '--name', 'pg', + # All Cloud Build containers are part of the cloudbuild docker + # network. This allows the container in the next step to refer + # to this container by its name. + '--network', 'cloudbuild', + # Create the test database with the same collation as prod (which has + # the settings LC_COLLATE=C and LC_CTYPE=C). + '-e', 'LANG=C', + 'postgres:11.4'] + +# Run the all.bash script in CI mode, using the standard golang docker +# container. That container is built on a standard Debian image, so it +# has bash and other common binaries in addition to the go toolchain. +- name: 'golang:1.13' + env: + - GO111MODULE=on + - GOPROXY=https://proxy.golang.org + # Refer to the container started in the above step. + - GO_DISCOVERY_DATABASE_TEST_HOST=pg + args: ['./all.bash', 'ci']