-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloudbuild.yaml
35 lines (32 loc) · 1015 Bytes
/
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
steps:
- name: 'gcr.io/kaniko-project/executor:latest'
id: 'Build & Push Image'
args:
- '--destination=us.gcr.io/$PROJECT_ID/$_IMAGE_NAME:$SHORT_SHA'
- '--destination=us.gcr.io/$PROJECT_ID/$_IMAGE_NAME:latest'
- '--dockerfile=Dockerfile'
- '--context=.'
- '--cache=true'
- '--cache-ttl=120h'
- id: 'Deploy to Cloud Run'
name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
gcloud run deploy $_SERVICE_NAME \
--image=us.gcr.io/$PROJECT_ID/$_IMAGE_NAME:$SHORT_SHA \
--region=$_REGION_NAME \
--platform managed \
--allow-unauthenticated \
--set-env-vars "API_VERSION_LATEST=v2" \
--set-env-vars "GIN_MODE=release"
--set-env-vars "SENTRY_DSN=$_SENTRY_DSN" \
substitutions:
# Google Cloud Build / Run variables:
_IMAGE_NAME: observerly-nocturnal
_REGION_NAME: us-central1
_SERVICE_NAME: nocturnal
_SENTRY_DSN: ''
options:
logging: CLOUD_LOGGING_ONLY