-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
23 lines (20 loc) · 947 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
steps:
# Build and tag the image.
- name: 'gcr.io/cloud-builders/docker'
id: Build
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/rails-google-cloud-run:$REVISION_ID', '.', '--build-arg', 'RAILS_ENV=${_RAILS_ENV}', '--build-arg', 'RAILS_MASTER_KEY=${_RAILS_MASTER_KEY}' ]
env:
- 'RAILS_ENV=${_RAILS_ENV}'
- 'RAILS_MASTER_KEY=${_RAILS_MASTER_KEY}'
- 'RAILS_LOG_TO_STDOUT=1'
- name: 'gcr.io/cloud-builders/docker'
id: Push
args: ['push', 'gcr.io/$PROJECT_ID/rails-google-cloud-run:$REVISION_ID']
# Deploy
- name: 'gcr.io/cloud-builders/gcloud'
id: Deploy
args: [ 'beta', 'run', 'deploy', 'rails-google-cloud-run', '--image', 'gcr.io/$PROJECT_ID/rails-google-cloud-run:$REVISION_ID', '--platform', 'managed', '--region', '${_REGION}', '--add-cloudsql-instances', '${_SQL_INSTANCE}', '--allow-unauthenticated']
env:
- 'RAILS_ENV=${_RAILS_ENV}'
- 'RAILS_MASTER_KEY=${_RAILS_MASTER_KEY}'
- 'RAILS_LOG_TO_STDOUT=1'