-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
36 lines (32 loc) · 1.11 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
steps:
# Install dependencies
- name: python:3.7
entrypoint: pip
args: ["install", "-r", "./frontapp/requirements.txt", "--user"]
# # Run unit tests
# - name: python
# entrypoint: python
# args: ["-m", "pytest", "--junitxml=${SHORT_SHA}_test_log.xml"]
# Docker Build
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t',
'gcr.io/$PROJECT_ID/cloudrun/crimemap:$SHORT_SHA', './frontapp/']
# Docker push to Google Artifact Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/cloudrun/crimemap:$SHORT_SHA']
# Deploy to Cloud Run
- name: google/cloud-sdk
args: ['gcloud', 'run', 'deploy', 'crimemap',
'--image=gcr.io/$PROJECT_ID/cloudrun/crimemap:$SHORT_SHA',
'--region', 'europe-west1', '--platform', 'managed',
'--allow-unauthenticated', --min-instances, '1']
#
## Save test logs to Google Cloud Storage
#artifacts:
# objects:
# location: gs://$_BUCKET_NAME/
# paths:
# - ${SHORT_SHA}_test_log.xml
# Store images in Google Artifact Registry
images:
- gcr.io/$PROJECT_ID/cloudrun/crimemap:$SHORT_SHA