-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtest.yaml
104 lines (103 loc) · 3.2 KB
/
test.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
# 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
#
# 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.
steps:
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
id: "clean"
entrypoint: bash
args: ['./clean']
- name: 'gcr.io/cloud-builders/git'
id: "ssh-init"
secretEnv: ['SSH_KEY']
entrypoint: 'bash'
args:
- -c
- |
ssh-keyscan -t rsa github.com > known_hosts.github
echo "$$SSH_KEY" >> /root/.ssh/id_rsa
chmod 400 /root/.ssh/id_rsa
cp known_hosts.github /root/.ssh/known_hosts
volumes:
- name: 'ssh'
path: /root/.ssh
waitFor: ['-']
- name: 'bash'
id: "creds"
args: ['-c','echo $$CREDS > creds.json']
secretEnv: ['CREDS']
waitFor: ['ssh-init']
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
id: "test-file-get"
entrypoint: bash
args: ['-c','GOOGLE_APPLICATION_CREDENTIALS=creds.json && ./update']
dir: "tools/testdata_updater/"
volumes:
- name: 'ssh'
path: /root/.ssh
waitFor: ['creds']
- name: 'golang'
id: "test-deploystack"
args: [ 'go', 'test', '.', '-v', '-cover' ]
env:
- 'DEPLOYSTACK_PATH=$_DEPLOYSTACK_PATH'
waitFor: ['test-file-get']
- name: 'golang'
id: "test-deploystack-config"
entrypoint: 'go'
args: [ 'test', '.', '-v', '-cover' ]
dir: "config"
env:
- 'DEPLOYSTACK_PATH=$_DEPLOYSTACK_PATH'
waitFor: ['test-file-get']
- name: 'golang'
id: "test-deploystack-terraform"
entrypoint: 'go'
args: [ 'test', '.', '-v', '-cover' ]
dir: "terraform"
env:
- 'DEPLOYSTACK_PATH=$_DEPLOYSTACK_PATH'
waitFor: ['test-file-get']
- name: 'golang'
id: "test-deploystack-tui"
entrypoint: 'go'
args: [ 'test', '.', '-v', '-cover' ]
dir: "tui"
env:
- 'DEPLOYSTACK_PATH=$_DEPLOYSTACK_PATH'
waitFor: ['test-file-get']
- name: 'golang'
id: "test-deploystack-github"
entrypoint: 'go'
args: [ 'test', '.', '-v', '-cover' ]
dir: "github"
env:
- 'DEPLOYSTACK_PATH=$_DEPLOYSTACK_PATH'
waitFor: ['test-file-get']
- name: 'gcr.io/cloudshell-images/cloudshell:latest'
id: "test-deploystack-gcloud"
args: [ 'go', 'test', '.', '-v', '-cover' ]
dir: "gcloud"
env:
- 'DEPLOYSTACK_PATH=$_DEPLOYSTACK_PATH'
waitFor: ['test-file-get', 'clean']
timeout: 3600s
substitutions:
_DEPLOYSTACK_PATH: /workspace
options:
machineType: 'E2_HIGHCPU_8'
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/creds/versions/latest
env: 'CREDS'
- versionName: projects/$PROJECT_ID/secrets/ssh-private-key/versions/latest
env: 'SSH_KEY'