forked from GoogleCloudPlatform/cloud-run-mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
131 lines (117 loc) · 3.72 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
# Copyright 2021 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
#
# https://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.
timeout: 1200s
options:
substitution_option: ALLOW_LOOSE
machineType: 'N1_HIGHCPU_8'
# Execution environment:
# HOME=/builder/home
# pwd=/workspace
# BUILDER_OUTPUT=/builder/outputs
# GOCACHE=/gocache
# When creating trggers, replace the tag with either _PR_NUMBER, TAG_NAME or BRANCH_NAME
substitutions:
_TAG: tmp
steps:
- name: gcr.io/wlhe-cr/crm-builder
entrypoint: /bin/sh
id: debug
waitFor:
- "-"
env:
- KRUN_IMAGE=gcr.io/${PROJECT_ID}/krun:${_TAG}
- HGATE_IMAGE=gcr.io/${PROJECT_ID}/krun/gate:${_TAG}
- FORTIO_IMAGE=gcr.io/${PROJECT_ID}/fortio-mesh:${_TAG}
args:
- -c
- |
env
- name: gcr.io/wlhe-cr/crm-builder
id: push
waitFor:
- "-"
env:
- PROJECT_ID=${PROJECT_ID}
- KRUN_IMAGE=gcr.io/${PROJECT_ID}/krun:${_TAG}
- HGATE_IMAGE=gcr.io/${PROJECT_ID}/krun/gate:${_TAG}
args:
- -c
- |
make build docker/krun push/krun docker/hgate push/hgate
- name: gcr.io/wlhe-cr/crm-builder
id: fortio
waitFor:
- "push"
env:
- GOLDEN_IMAGE=gcr.io/${PROJECT_ID}/krun:${_TAG}
- FORTIO_IMAGE=gcr.io/${PROJECT_ID}/fortio-mesh:${_TAG}
args:
- -c
- |
cd samples/fortio
make image push
- name: gcr.io/wlhe-cr/crm-builder
id: test
env:
- CLUSTER_NAME=asm-cr
- CLUSTER_LOCATION=us-central1-c
- KUBECONFIG=/workspace/kubeconfig
waitFor:
- "-"
args:
- -c
- |
gcloud container clusters get-credentials $${CLUSTER_NAME} --zone us-central1-c --project $PROJECT_ID
make test
# Deploy the in-cluster connector. Note that the runner doesn't have RBAC permissions
# The cluster must be setup with the RBAC manually.
- name: gcr.io/wlhe-cr/crm-builder
id: hgatedeploy
env:
- HGATE_IMAGE=gcr.io/${PROJECT_ID}/krun/gate:${_TAG}
- CLUSTER_NAME=asm-cr
- CLUSTER_LOCATION=us-central1-c
- KUBECONFIG=/workspace/kubeconfig
waitFor:
- push
args:
- -c
- |
gcloud container clusters get-credentials $${CLUSTER_NAME} --zone us-central1-c --project $PROJECT_ID
make deploy/hgate
# Deploy the canary, run tests
# Missing alpha command in 'gcr.io/google.com/cloudsdktool/cloud-sdk', also too large.
# This is built with 'make gcp/builder-gcloud', alpine based.
- name: gcr.io/wlhe-cr/crm-builder
entrypoint: /bin/sh
env:
- FORTIO_IMAGE=gcr.io/${PROJECT_ID}/fortio-mesh:${_TAG}
- CLUSTER_NAME=asm-cr
- CLUSTER_LOCATION=us-central1-c
- KUBECONFIG=/workspace/kubeconfig
waitFor:
- fortio
- hgatedeploy
args:
- -c
- |
make e2e
# TODO: combine gcloud, go, etc in single image - Istio build image is huge
# Also includes gcloud 349.0.0
# https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/ko is a good
# base, includes ko, kubectl, gcloud
# They use: CLOUDSDK_COMPUTE_ZONE, CLOUDSDK_CONTAINER_CLUSTER, CLOUDSDK_COREPROJECT
#go get -u github.com/jstemmer/go-junit-report
#2>&1 go test -timeout 1m -v ./... | tee sponge.log
#/go/bin/go-junit-report -set-exit-code < sponge.log > ${SHORT_SHA}_test_log.xml