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 682f80f commit 3736f27
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
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'
# - '--quiet'
# id: Deploy
# entrypoint: gcloud
# - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
# args:
# - run
# - services
# - update-traffic
# - $_SERVICE_NAME
# - '--platform=managed'
# - '--region=$_DEPLOY_REGION'
# - '--to-latest'
# - '--quiet'
# id: UpdateTraffic
# entrypoint: gcloud
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
args:
- deploy
- apply
- '--region=$_DEPLOY_REGION'
- '--file=deploy/clouddeploy.yaml'
id: ApplyCloudDeployDeliveryPipeline
entrypoint: gcloud
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
args:
- deploy
- releases
- create
- release-$SHORT_SHA
- '--region=$_DEPLOY_REGION'
- '--delivery-pipeline=demo-backend-api'
- '--skaffold-file=deploy/skaffold.yaml'
- >-
--images=demo-backend-api=$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
id: CreateCloudDeployRelease
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 3736f27

Please sign in to comment.