-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcloudbuild.yaml
73 lines (66 loc) · 1.96 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
steps:
- id: Install cloud_sql_proxy
name: gcr.io/cloud-builders/wget
entrypoint: bash
args:
- -c
- wget -O ./cloud_sql_proxy https://storage.googleapis.com/cloudsql-proxy/v1.15/cloud_sql_proxy.linux.386 && chmod +x ./cloud_sql_proxy
- id: 'Decrypt secrets required for deployment'
name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- kms
- decrypt
- --ciphertext-file=./eagleproject/app.yaml.enc
- --plaintext-file=./eagleproject/app.yaml
- --location=global
- --keyring=origin
- --key=cloudbuild
- id: 'Decrypt secrets required for deployment 2'
name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- kms
- decrypt
- --ciphertext-file=./eagleproject/reports_worker.yaml.enc
- --plaintext-file=./eagleproject/reports_worker.yaml
- --location=global
- --keyring=origin
- --key=cloudbuild
- id: 'Decrypt env required for build'
name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- kms
- decrypt
- --ciphertext-file=./eagleproject/.envkey.enc
- --plaintext-file=./eagleproject/.envkey
- --location=global
- --keyring=origin
- --key=cloudbuild
- id: 'Install requirements, collectstatic, run migrations'
name: 'python:3.8'
dir: ./eagleproject
entrypoint: bash
args:
- '-c'
- |
export ENVKEY=$(cat .envkey)
# Run CloudSQL Proxy
../cloud_sql_proxy \
-instances="origin-214503:us-west2:ousd-analytics-w" \
-dir=/cloudsql &
sleep 3 && \
python3 -m pip install -r requirements.txt && \
python3 ./manage.py collectstatic --noinput && \
python3 ./manage.py migrate
- id: 'Deploy the web facing service and worker'
name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
dir: ./eagleproject
entrypoint: gcloud
args:
- app
- deploy
- /workspace/eagleproject/reports_worker.yaml
- /workspace/eagleproject/app.yaml
timeout: "3200s"