forked from googleforgames/agones
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
154 lines (133 loc) · 3.64 KB
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Copyright 2017 Google Inc. All Rights Reserved.
#
# 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.
#
# Google Cloud Builder CI configuration
#
steps:
#
# Creates the initial make + docker build platform
#
- name: "ubuntu"
args: ["bash", "-c", "echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build"]
- name: "gcr.io/cloud-builders/docker"
args: ['build', '-f', 'Dockerfile.build', '-t', 'make-docker', '.'] # we need docker and make to run everything.
- name: "make-docker"
id: make-docker
dir: "build"
args: ["pull-build-image"] # pull the build image if it exists
#
# build the e2e test runner
#
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-f', 'Dockerfile', '-t', 'e2e-runner', '.']
dir: 'build/e2e-image'
id: build-e2e
waitFor: ['-']
#
# Runs the linter -- but also builds the build image, if not able to download
#
- name: "make-docker"
id: lint
waitFor:
- make-docker
dir: "build"
args: ["lint"] # pull the build image if it exists
#
# Run the all the automated tests (except e2e) in parallel
#
- name: "make-docker"
id: tests
waitFor:
- lint
dir: "build"
args: [ "-j", "3", "test" ]
#
# Push the build image, can run while we do other things.
#
- name: "make-docker"
waitFor:
- lint
dir: "build"
args: ["push-build-image"] # push the build image (which won't do anything if it's already there)
#
# Build all the images and sdks, and push them up to the repository
#
- name: "make-docker"
id: build
waitFor:
- lint
dir: "build"
args: [ "-j", "4", "build"]
- name: "make-docker"
id: push-images
waitFor:
- build
dir: "build"
args: [ "-j", "3", "push"]
#
# Site preview
#
- name: "make-docker" # build a preview of the website
id: site-static
waitFor:
- tests
dir: "build"
args: ["site-static-preview", "site-gen-app-yaml", "SERVICE=preview"]
- name: "ubuntu" # fake a new gopath
id: site-gopath
waitFor:
- site-static
args: ["bash", "-c", "mkdir -p ./go/src && mv ./site ./go/src && cp -r ./vendor/gopkg.in ./go/src && ls -a ./go/src/site"]
- name: "gcr.io/cloud-builders/gcloud" # deploy the preview of the website
id: "deploy-site-static"
waitFor:
- site-gopath
dir: "go/src/site"
args: ["app", "deploy", ".app.yaml", "--no-promote", "--version=$SHORT_SHA"]
env:
- GOPATH=/workspace/go
#
# Run the e2e tests
#
- name: 'e2e-runner'
waitFor:
- push-images
- build-e2e
#
# Zip up artifacts and push to storage
#
- name: 'gcr.io/cloud-builders/gsutil'
waitFor:
- build
- tests
dir: "sdks/cpp/bin"
args: ['cp', '*.tar.gz', 'gs://agones-artifacts/cpp-sdk']
- name: 'gcr.io/cloud-builders/gsutil'
waitFor:
- build
- tests
dir: "sdks/cpp/bin"
args: ['cp', '*.zip', 'gs://agones-artifacts/cpp-sdk']
- name: 'gcr.io/cloud-builders/gsutil'
waitFor:
- build
- tests
dir: "cmd/sdk-server/bin"
args: ['cp', '*.zip', 'gs://agones-artifacts/sdk-server']
tags: ['ci']
timeout: "1h"
images: ['gcr.io/$PROJECT_ID/agones-controller', 'gcr.io/$PROJECT_ID/agones-sdk', 'gcr.io/$PROJECT_ID/agones-ping']
logsBucket: "gs://agones-build-logs"
options:
machineType: 'N1_HIGHCPU_8'