-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
42 lines (38 loc) · 1.39 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
steps:
# build the container image
- name: "gcr.io/cloud-builders/docker"
args:
[
"build",
"-t",
"europe-west1-docker.pkg.dev/$PROJECT_ID/sghi/mle-${_DEPLOYMENT_TYPE}:$COMMIT_SHA",
".",
]
# Push the container image to Container Registry
- name: "gcr.io/cloud-builders/docker"
args:
["push", "europe-west1-docker.pkg.dev/$PROJECT_ID/sghi/mle-${_DEPLOYMENT_TYPE}:$COMMIT_SHA"]
# Deploy an image from Container Registry to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args: [
'beta',
'run',
'deploy',
'${_SERVICE_NAME}',
'--image', 'europe-west1-docker.pkg.dev/$PROJECT_ID/sghi/mle-${_DEPLOYMENT_TYPE}:$COMMIT_SHA',
'--region', 'europe-west1',
'--platform', 'managed',
'--allow-unauthenticated',
'--add-cloudsql-instances', '${_CLOUDSQL_INSTANCE_CONNECTION_NAME}',
'--set-env-vars', 'GOOGLE_CLOUD_PROJECT=$PROJECT_ID,SETTINGS_NAME=${_SETTINGS_NAME},DJANGO_SETTINGS_MODULE=config.settings.production,DEFAULT_ORG_ID=99edd1b5-1ff2-49f4-8b0e-261c78909695',
'--min-instances', '1',
'--max-instances', '8',
'--memory', '512M',
'--cpu', '1',
'--set-secrets', '/tmp/secrets/.env=${_SETTINGS_NAME}:latest',
'--timeout', '59m59s'
]
images:
- "europe-west1-docker.pkg.dev/$PROJECT_ID/sghi/mle-${_DEPLOYMENT_TYPE}:$COMMIT_SHA"
timeout: 1200s
queueTtl: 3600s