Skip to content

Commit

Permalink
chore: add build yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
yamashita-kenngo committed May 3, 2024
1 parent 6323403 commit 03a35f7
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions cloudbuild_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
steps:
- name: gcr.io/cloud-builders/docker
args:
- build
- '--no-cache'
- '-t'
- >-
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
- .
- '-f'
- Dockerfile
id: Build
- name: gcr.io/cloud-builders/docker
args:
- push
- >-
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
id: Push
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
args:
- run
- services
- update
- $_SERVICE_NAME
- '--platform=managed'
- >-
--image=$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
- >-
--labels=managed-by=gcp-cloud-build-deploy-cloud-run,commit-sha=$COMMIT_SHA,gcb-build-id=$BUILD_ID,gcb-trigger-id=$_TRIGGER_ID
- '--region=$_DEPLOY_REGION'
- >-
--tag=$BRANCH_NAME
- '--quiet'
- '--no-traffic'
id: DeployTag
entrypoint: gcloud
images:
- >-
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
options:
substitutionOption: ALLOW_LOOSE
substitutions:
_PLATFORM: managed
_SERVICE_NAME: demo-backend-api
_TRIGGER_ID: 5769c5a8-3db3-4015-a4d1-0e1d21ba0561
_DEPLOY_REGION: asia-northeast1
_AR_HOSTNAME: asia-northeast1-docker.pkg.dev
tags:
- gcp-cloud-build-deploy-cloud-run
- gcp-cloud-build-deploy-cloud-run-managed
- demo-backend-api

0 comments on commit 03a35f7

Please sign in to comment.