mirror of
https://github.com/googleforgames/open-match.git
synced 2025-03-25 13:24:18 +00:00
* update base_version in makefile to 1.3.0 * updated appversion and version in chart.yaml * updated tag entries in values.yaml * updated the _om_version in cloudbuild.yaml * update dependecies across various files
178 lines
7.1 KiB
YAML
178 lines
7.1 KiB
YAML
# Copyright 2019 Google LLC
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
################################################################################
|
|
# Open Match Script for Google Cloud Build #
|
|
################################################################################
|
|
|
|
# To run this locally:
|
|
# cloud-build-local --config=cloudbuild.yaml --dryrun=false --substitutions=_OM_VERSION=DEV .
|
|
# To run this remotely:
|
|
# gcloud builds submit --config=cloudbuild.yaml --substitutions=_OM_VERSION=DEV .
|
|
|
|
# Requires gcloud to be installed to work. (https://cloud.google.com/sdk/)
|
|
# gcloud auth login
|
|
# gcloud components install cloud-build-local
|
|
|
|
# This YAML contains all the build steps for building Open Match.
|
|
# All PRs are verified against this script to prevent build breakages and regressions.
|
|
|
|
# Conventions
|
|
# Each build step is ID'ed with "Prefix: Description".
|
|
# The prefix portion determines what kind of step it is and it's impact.
|
|
# Docker Image: Read-Only, outputs a docker image.
|
|
# Lint: Read-Only, verifies correctness and formatting of a file.
|
|
# Build: Read-Write, outputs a build artifact. Ok to run in parallel if the artifact will not collide with another one.
|
|
# Generate: Read-Write, outputs files within /workspace that are used in other build step. Do not run these in parallel.
|
|
# Setup: Read-Write, similar to generate but steps that run before any other step.
|
|
|
|
# Some useful things to know about Cloud Build.
|
|
# The root of this repository is always stored in /workspace.
|
|
# Any modifications that occur within /workspace are persisted between builds anything else is forgotten.
|
|
# If a build step has intermediate files that need to be persisted for a future step then use volumes.
|
|
# An example of this is the go-vol which is where the pkg/ data for go mod is stored.
|
|
# More information here: https://cloud.google.com/cloud-build/docs/build-config#build_steps
|
|
# A build step is basically a docker image that is tuned for Cloud Build,
|
|
# https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/go
|
|
|
|
steps:
|
|
- id: 'Docker Image: open-match-build'
|
|
name: gcr.io/cloud-builders/docker
|
|
args: ['build', '-t', 'gcr.io/$PROJECT_ID/open-match-build', '-f', 'Dockerfile.ci', '.']
|
|
waitFor: ['-']
|
|
|
|
- id: 'Build: Clean'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', 'clean-third-party', 'clean-protos', 'clean-swagger-docs']
|
|
waitFor: ['Docker Image: open-match-build']
|
|
|
|
# - id: 'Test: Markdown'
|
|
# name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
# args: ['make', 'md-test']
|
|
# waitFor: ['Build: Clean']
|
|
|
|
- id: 'Setup: Download Dependencies'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', 'sync-deps']
|
|
volumes:
|
|
- name: 'go-vol'
|
|
path: '/go'
|
|
waitFor: ['Build: Clean']
|
|
|
|
- id: 'Build: Initialize Toolchain'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', 'install-toolchain']
|
|
volumes:
|
|
- name: 'go-vol'
|
|
path: '/go'
|
|
waitFor: ['Setup: Download Dependencies']
|
|
|
|
- id: 'Test: Terraform Configuration'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', 'terraform-test']
|
|
waitFor: ['Build: Initialize Toolchain']
|
|
|
|
- id: 'Build: Deployment Configs'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', 'SHORT_SHA=${SHORT_SHA}', 'update-chart-deps', 'install/yaml/']
|
|
waitFor: ['Build: Initialize Toolchain']
|
|
|
|
- id: 'Build: Assets'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', '_CHARTS_BUCKET=${_CHARTS_BUCKET}', 'assets', '-j12']
|
|
volumes:
|
|
- name: 'go-vol'
|
|
path: '/go'
|
|
waitFor: ['Build: Deployment Configs']
|
|
|
|
- id: 'Build: Binaries'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', 'GOPROXY=off', 'build', 'all', '-j12']
|
|
volumes:
|
|
- name: 'go-vol'
|
|
path: '/go'
|
|
waitFor: ['Build: Assets']
|
|
|
|
- id: 'Test: Services'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', 'GOPROXY=off', 'GOLANG_TEST_COUNT=10', 'test']
|
|
volumes:
|
|
- name: 'go-vol'
|
|
path: '/go'
|
|
waitFor: ['Build: Assets']
|
|
|
|
- id: 'Build: Docker Images'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', '_GCB_POST_SUBMIT=${_GCB_POST_SUBMIT}', '_GCB_LATEST_VERSION=${_GCB_LATEST_VERSION}', 'SHORT_SHA=${SHORT_SHA}', 'BRANCH_NAME=${BRANCH_NAME}', 'push-images', '-j8']
|
|
waitFor: ['Build: Assets']
|
|
|
|
- id: 'Lint: Format, Vet, Charts'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', 'lint']
|
|
volumes:
|
|
- name: 'go-vol'
|
|
path: '/go'
|
|
waitFor: ['Build: Assets']
|
|
|
|
- id: 'Test: Deploy Open Match'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', 'SHORT_SHA=${SHORT_SHA}', 'OPEN_MATCH_KUBERNETES_NAMESPACE=open-match-${BUILD_ID}', 'OPEN_MATCH_RELEASE_NAME=open-match-${BUILD_ID}', 'auth-gke-cluster', 'delete-chart', 'ci-reap-namespaces', 'install-ci-chart']
|
|
waitFor: ['Build: Docker Images']
|
|
|
|
- id: 'Deploy: Deployment Configs'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', '_GCB_POST_SUBMIT=${_GCB_POST_SUBMIT}', '_GCB_LATEST_VERSION=${_GCB_LATEST_VERSION}', 'SHORT_SHA=${SHORT_SHA}', 'BRANCH_NAME=${BRANCH_NAME}', '_CHARTS_BUCKET=${_CHARTS_BUCKET}', 'ci-deploy-artifacts']
|
|
waitFor: ['Lint: Format, Vet, Charts', 'Test: Deploy Open Match']
|
|
volumes:
|
|
- name: 'go-vol'
|
|
path: '/go'
|
|
|
|
- id: 'Test: End-to-End Cluster'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', 'GOPROXY=off', 'SHORT_SHA=${SHORT_SHA}', 'OPEN_MATCH_KUBERNETES_NAMESPACE=open-match-${BUILD_ID}', 'test-e2e-cluster']
|
|
waitFor: ['Test: Deploy Open Match', 'Build: Assets']
|
|
volumes:
|
|
- name: 'go-vol'
|
|
path: '/go'
|
|
|
|
- id: 'Test: Delete Open Match'
|
|
name: 'gcr.io/$PROJECT_ID/open-match-build'
|
|
args: ['make', 'GCLOUD_EXTRA_FLAGS=--async', 'SHORT_SHA=${SHORT_SHA}', 'OPEN_MATCH_KUBERNETES_NAMESPACE=open-match-${BUILD_ID}', 'OPEN_MATCH_RELEASE_NAME=open-match-${BUILD_ID}', 'GCP_PROJECT_ID=${PROJECT_ID}', 'delete-chart']
|
|
waitFor: ['Test: End-to-End Cluster']
|
|
|
|
artifacts:
|
|
objects:
|
|
location: '${_ARTIFACTS_BUCKET}'
|
|
paths:
|
|
- install/yaml/install.yaml
|
|
- install/yaml/01-open-match-core.yaml
|
|
- install/yaml/02-open-match-demo.yaml
|
|
- install/yaml/03-prometheus-chart.yaml
|
|
- install/yaml/04-grafana-chart.yaml
|
|
- install/yaml/05-jaeger-chart.yaml
|
|
- install/yaml/06-open-match-override-configmap.yaml
|
|
|
|
substitutions:
|
|
_OM_VERSION: "1.3.0"
|
|
_GCB_POST_SUBMIT: "0"
|
|
_GCB_LATEST_VERSION: "undefined"
|
|
_ARTIFACTS_BUCKET: "gs://open-match-build-artifacts/output/"
|
|
_LOGS_BUCKET: "gs://open-match-build-logs/"
|
|
_CHARTS_BUCKET: "gs://open-match-chart"
|
|
logsBucket: '${_LOGS_BUCKET}'
|
|
options:
|
|
sourceProvenanceHash: ['SHA256']
|
|
machineType: 'N1_HIGHCPU_32'
|
|
timeout: 2500s
|