-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloudbuild.yaml
17 lines (15 loc) · 946 Bytes
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Automatically re-deploys the Cloud Run service on code change
steps:
# build the container image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', '${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPO_NAME}/datastore-cleaner:${COMMIT_SHA}', '.']
# push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', '${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPO_NAME}/datastore-cleaner:${COMMIT_SHA}']
# Deploy container image to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args: ['run', 'deploy', 'datastore-cleaner', '--image', '${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPO_NAME}/datastore-cleaner:${COMMIT_SHA}', '--region', '${_REGION}', '--quiet']
substitutions:
_REGION: us-central1 # default to us-central1
_REPO_NAME: containers # default Artifact Registry repostory name
images: ['${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPO_NAME}/datastore-cleaner:${COMMIT_SHA}']