-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild-preview.yaml
More file actions
28 lines (24 loc) · 1.06 KB
/
Copy pathcloudbuild-preview.yaml
File metadata and controls
28 lines (24 loc) · 1.06 KB
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
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t',
'gcr.io/${PROJECT_ID}/${_SERVICE_NAME}:${_PR_NUMBER}-${SHORT_SHA}', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['push',
'gcr.io/${PROJECT_ID}/${_SERVICE_NAME}:${_PR_NUMBER}-${SHORT_SHA}' ]
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: 'gcloud'
args: ['beta', 'run', 'deploy', '${_SERVICE_NAME}',
'--platform', 'managed', '--region', '${_REGION}',
'--image', 'gcr.io/${PROJECT_ID}/${_SERVICE_NAME}:${_PR_NUMBER}-${SHORT_SHA}',
'--tag', 'pr-${_PR_NUMBER}',
'--no-traffic']
- name: 'gcr.io/${PROJECT_ID}/set-check-status'
args: ['--project-id', '${PROJECT_ID}',
'--region', '${_REGION}',
'--service', '${_SERVICE_NAME}',
'--tag', 'pr-${_PR_NUMBER}',
'--repo-name', '${_GITHUB_USER}/${REPO_NAME}',
'--commit-sha', '${SHORT_SHA}']
substitutions:
_SERVICE_NAME: myservice
_REGION: us-central1