-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
43 lines (39 loc) · 1.32 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
# You would want to use this in your GCP CloudBuild, aid with image building, scanning and release of any further customisations
steps:
# Step 1: Build the Docker image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/briefops:$COMMIT_SHA', '.']
id: 'Build Image'
# Step 2: Push the Docker image to Google Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/briefops:$COMMIT_SHA']
id: 'Push Image'
# Step 3: Deploy to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- '${_SERVICE}'
- '--image'
- 'gcr.io/$PROJECT_ID/briefops:$COMMIT_SHA'
- '--region'
- '${_REGION}'
- '--platform'
- 'managed'
- '--allow-unauthenticated'
- '--set-secrets'
- 'SLACK_APP_TOKEN=SLACK_APP_TOKEN:latest'
- '--set-secrets'
- 'SLACK_BOT_TOKEN=SLACK_BOT_TOKEN:latest'
- '--set-secrets'
- 'SLACK_SIGNING_SECRET=SLACK_SIGNING_SECRET:latest'
- '--service-account'
id: 'Deploy to Cloud Run'
# Logging options set to CLOUD_LOGGING_ONLY
options:
logging: CLOUD_LOGGING_ONLY
substitutions:
_REGION: us-central1
_SERVICE: briefops