Skip to content

Commit 644ebf5

Browse files
committed
Add cloud build cmd
1 parent 88210ad commit 644ebf5

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,6 @@ deploy-production: publish-production ## Deploy new revision to GCP
130130

131131
promote-production: ## Serve new revision to GCP
132132
gcloud run services update-traffic simdec-panel --to-latest
133+
134+
cloudbuild-production: ## Build, Deploy and Serve new revision to GCP using cloudbuild
135+
gcloud builds submit --config panel/cloudbuild.yaml --substitutions COMMIT_SHA=$(git rev-list --max-count=1 HEAD) .

panel/cloudbuild.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ steps:
77
- '--no-cache'
88
- '-t'
99
- >-
10-
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
10+
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/simdec-python/simdec-panel:$COMMIT_SHA
1111
- .
1212
- '-f'
1313
- panel/Dockerfile
@@ -16,13 +16,13 @@ steps:
1616
args:
1717
- push
1818
- >-
19-
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
19+
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/simdec-python/simdec-panel:$COMMIT_SHA
2020
id: Push
2121
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
2222
args:
2323
- run
2424
- deploy
25-
- $_SERVICE_NAME
25+
- simdec-panel
2626
- '--cpu=2'
2727
- '--memory'
2828
- '2Gi'
@@ -43,7 +43,7 @@ steps:
4343
- '--timeout=60m'
4444
- '--service-account=simdec-panel@delta-entity-401706.iam.gserviceaccount.com'
4545
- >-
46-
--image=$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
46+
--image=$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/simdec-python/simdec-panel:$COMMIT_SHA
4747
- >-
4848
--labels=managed-by=gcp-cloud-build-deploy-cloud-run,commit-sha=$COMMIT_SHA,gcb-build-id=$BUILD_ID,gcb-trigger-id=$_TRIGGER_ID
4949
- '--region=$_DEPLOY_REGION'
@@ -54,21 +54,20 @@ steps:
5454
- run
5555
- services
5656
- update-traffic
57-
- $_SERVICE_NAME
57+
- simdec-panel
5858
- '--region=$_DEPLOY_REGION'
5959
- '--to-latest'
6060
id: Serve
6161
entrypoint: gcloud
6262
images:
6363
- >-
64-
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
64+
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/simdec-python/simdec-panel:$COMMIT_SHA
6565
options:
6666
substitutionOption: ALLOW_LOOSE
6767
logging: CLOUD_LOGGING_ONLY
6868
substitutions:
6969
_AR_HOSTNAME: europe-north1-docker.pkg.dev
7070
_TRIGGER_ID: 8ebd7eb7-1e16-4c90-a93d-ba76058df26d
71-
_SERVICE_NAME: simdec-panel
7271
_DEPLOY_REGION: europe-north1
7372
tags:
7473
- gcp-cloud-build-deploy-cloud-run

0 commit comments

Comments
 (0)