-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild-test.yaml
44 lines (40 loc) · 1.32 KB
/
cloudbuild-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
steps:
# Access the id_github file from Secret Manager, and setup SSH
- name: 'gcr.io/cloud-builders/git'
secretEnv: ['SSH_KEY']
entrypoint: 'bash'
args:
- -c
- |
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
# Get submodules
- name: 'gcr.io/cloud-builders/git'
args: [ 'submodule', 'update', '--init', '--recursive' ]
volumes:
- name: 'ssh'
path: /root/.ssh
# Build ce-deployer docker image
- name: 'gcr.io/kaniko-project/executor:latest'
args:
- --destination=gcr.io/$PROJECT_ID/ce-deployer:latest
- --destination=gcr.io/climate-engine-public/climate-engine/ce-deployer:latest
- --cache=true
- --cache-ttl=48h
- --dockerfile=Dockerfile-ce-deployer
# Marketplace Deployer (calls a Job to run CE Deployer)
- name: 'gcr.io/kaniko-project/executor:latest'
args:
- --destination=gcr.io/$PROJECT_ID/deployer:latest
- --destination=gcr.io/climate-engine-public/climate-engine/deployer:latest
- --cache=true
- --cache-ttl=48h
- --dockerfile=Dockerfile
availableSecrets:
secretManager:
- versionName: projects/378574554703/secrets/cloudbuild-github-key/versions/latest
env: 'SSH_KEY'