-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
75 lines (75 loc) · 2.13 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
steps:
- name: 'gcr.io/cloud-builders/docker'
id: build-potal
args: [
'build',
'-f', './docker/potal/Dockerfile',
'-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/potal/potal:$COMMIT_SHA',
'-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/potal/potal:latest',
'.',
]
waitFor: ['-']
- name: 'gcr.io/cloud-builders/docker'
id: push-potal
args: [ 'push', 'us-central1-docker.pkg.dev/$PROJECT_ID/potal/potal:$COMMIT_SHA']
waitFor: ['build-potal']
- name: 'gcr.io/cloud-builders/docker'
id: build-backend
args: [
'build',
'-f', './docker/backend/Dockerfile',
'-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/backend/backend:$COMMIT_SHA',
'-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/backend/backend:latest',
'.',
]
waitFor: ['-']
- name: 'gcr.io/cloud-builders/docker'
id: push-backend
args: [ 'push', 'us-central1-docker.pkg.dev/$PROJECT_ID/backend/backend:$COMMIT_SHA']
waitFor: ['build-backend']
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
id: deploy-potal
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'potal'
- '--image'
- 'us-central1-docker.pkg.dev/$PROJECT_ID/potal/potal:$COMMIT_SHA'
- '--region'
- 'us-central1'
waitFor: ['push-potal']
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
id: deploy-backend
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'backend'
- '--image'
- 'us-central1-docker.pkg.dev/$PROJECT_ID/backend/backend:$COMMIT_SHA'
- '--region'
- 'us-central1'
waitFor: ['push-backend']
- name: 'gcr.io/cloud-builders/npm'
id: 'npm-install'
args: ['install', '--frozen-lock']
waitFor: ['-']
- name: 'gcr.io/cloud-builders/npm'
id: 'build-assets'
args: ['run', 'build']
waitFor: ['npm-install']
secretEnv: ['SENTRY_AUTH_TOKEN']
images:
- 'us-central1-docker.pkg.dev/$PROJECT_ID/backend/backend:latest'
- 'us-central1-docker.pkg.dev/$PROJECT_ID/potal/potal:latest'
artifacts:
objects:
location: gs://gib-potato-assets/
paths:
- 'webroot/assets/*'
- 'webroot/.vite/manifest.json'
availableSecrets:
secretManager:
- versionName: projects/841923001753/secrets/sentry_auth_token/versions/1
env: 'SENTRY_AUTH_TOKEN'