-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
58 lines (51 loc) · 1.72 KB
/
cloudbuild.yaml
File metadata and controls
58 lines (51 loc) · 1.72 KB
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
steps:
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
env:
- 'STORAGE_BUCKET=${_STORAGE_BUCKET}'
script: |
#!/usr/bin/env bash
gsutil cp gs://$STORAGE_BUCKET/api/config.yaml /workspace/api
gsutil cp gs://$STORAGE_BUCKET/api/private.pem /workspace/api
gsutil cp gs://$STORAGE_BUCKET/api/public.pem /workspace/api
gsutil cp gs://$STORAGE_BUCKET/api/innovation.json /workspace/api
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk:slim"
env:
- 'DATABASE_URL=${_DATABASE_URL}'
- 'PROJECT_ID=$PROJECT_ID'
- 'CLOUDSQL_IP=${_CLOUDSQL_IP}'
- 'TUNNEL_VM=${_TUNNEL_VM}'
script: |
#!/usr/bin/env bash
pip install pymigratedb
migrate execute --dbstring $DATABASE_URL --driver pgsql
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--build-arg', 'ENVIRONMENT=${_ENVIRONMENT}', '--build-arg', 'SEC_PREFIX=${_SEC_PREFIX}', '--build-arg', 'AUTH_SERVER=${_AUTH_SERVER}', '-t', 'gcr.io/$PROJECT_ID/${_SERVICE_NAME}:$COMMIT_SHA', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/${_SERVICE_NAME}:$COMMIT_SHA']
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- '${_SERVICE_NAME}'
- '--image'
- 'gcr.io/$PROJECT_ID/${_SERVICE_NAME}:$COMMIT_SHA'
- '--region'
- 'us-east1'
- '--cpu'
- '${_CPUS}'
- '--memory'
- '${_MEMORY}'
- '--max-instances'
- '${_MAX_INSTANCES}'
- '--port'
- '9090'
- '--allow-unauthenticated'
- '--vpc-connector'
- '${_VPC_CONNECTOR}'
- '--vpc-egress'
- '${_EGRESS}'
- '--platform'
- 'managed'
images:
- 'gcr.io/$PROJECT_ID/${_SERVICE_NAME}:$COMMIT_SHA'