-
Notifications
You must be signed in to change notification settings - Fork 3
/
cloudbuild.yml
41 lines (41 loc) · 1.25 KB
/
cloudbuild.yml
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
# need 2 cpu cores and more mem, also make thingies push to branch instead of tag
steps:
- name: gcr.io/cloud-builders/docker
args:
- build
- '--no-cache'
- '-t'
- '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
- .
- '-f'
- Dockerfile
id: Build
- name: gcr.io/cloud-builders/docker
args:
- push
- '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
id: Push
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
args:
- run
- deploy
- $_SERVICE_NAME
- '--platform=managed'
- '--image=$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
- '--update-secrets=SLACK_BOT_TOKEN=HALY_MASTER_SLACK_BOT_TOKEN:latest,SLACK_SIGNING_SECRET=HALY_MASTER_SLACK_SIGNING_SECRET:latest,OPENAI_API_KEY=HALY_MASTER_OPEN_API_KEY:latest'
- '--region=us-central1'
- '--allow-unauthenticated'
- '--min-instances=2'
- '--cpu=2'
id: Deploy
entrypoint: gcloud
images:
- '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
options:
substitutionOption: ALLOW_LOOSE
logging: CLOUD_LOGGING_ONLY
substitutions:
_GCR_HOSTNAME: us.gcr.io
_SERVICE_NAME: haly-master
tags:
- haly-master