generated from Service-Design-Studio/rottenpotatoes-rails-intro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
39 lines (35 loc) · 1.1 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
# [START cloudrun_rails_cloudbuild]
steps:
- id: "build image"
name: "gcr.io/cloud-builders/docker"
entrypoint: 'bash'
args: ["-c", "docker build -t gcr.io/${PROJECT_ID}/${_SERVICE_NAME} . "]
- id: "push image"
name: "gcr.io/cloud-builders/docker"
args: ["push", "gcr.io/${PROJECT_ID}/${_SERVICE_NAME}"]
- id: "apply migrations"
name: "gcr.io/google-appengine/exec-wrapper"
entrypoint: "bash"
args:
[
"-c",
"/buildstep/execute.sh -i gcr.io/${PROJECT_ID}/${_SERVICE_NAME} -s ${PROJECT_ID}:${_REGION}:${_INSTANCE_NAME} -- bundle exec rake db:migrate"
]
- id: "run deploy"
name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
entrypoint: gcloud
args:
[
"run", "deploy",
"${_SERVICE_NAME}",
"--platform", "managed",
"--region", "${_REGION}",
"--image", "gcr.io/${PROJECT_ID}/${_SERVICE_NAME}"
]
substitutions:
_REGION: [YOUR REGION ]
_SERVICE_NAME: [YOUR SERVICE]
_INSTANCE_NAME: [CLOUD SQL INSTANCE NAME]
images:
- "gcr.io/${PROJECT_ID}/${_SERVICE_NAME}"
# [END cloudrun_rails_cloudbuild]