-
Notifications
You must be signed in to change notification settings - Fork 8
/
cloudbuild.yaml
37 lines (29 loc) · 915 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
36
37
steps:
# FRONTEND
- id: 'frontend-build'
waitFor: ['-']
name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/frontend:$COMMIT_SHA', 'frontend']
- id: 'frontend-push'
waitFor: ['frontend-build']
name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/frontend:$COMMIT_SHA']
# BACKEND
- id: 'backend-build'
waitFor: ['-']
name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/backend:$COMMIT_SHA', 'backend']
- id: 'backend-push'
waitFor: ['backend-build']
name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/backend:$COMMIT_SHA']
# DEPLOYMENT
- waitFor: ['frontend-push', 'backend-push']
name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- -c
- |
gcloud config set compute/zone us-east1-d
gcloud compute ssh user@main --command 'exit'
scripts/deploy $COMMIT_SHA