forked from aipictors/aipictors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
64 lines (64 loc) · 1.81 KB
/
cloudbuild.yaml
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
steps:
- name: bash
script: |
#!/usr/bin/env bash
if [ "${IS_PRODUCTION}" = "false" ]; then
mv .env.staging .env
fi
rm -rf .env.production.local
env:
- "IS_PRODUCTION=$_IS_PRODUCTION"
- "TRIGGER_ID=$_TRIGGER_ID"
id: Env
- name: bash
script: |
#!/usr/bin/env bash
sed -i 's/lefthook install/echo/g' package.json
id: PostInstall
- name: "gcr.io/cloud-builders/docker"
args:
- build
- --build-arg
- "SENTRY_AUTH_TOKEN=$_SENTRY_AUTH_TOKEN"
- -t
- $_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
- .
- 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
images:
- >-
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
options:
substitutionOption: ALLOW_LOOSE
# machineType: "E2_HIGHCPU_8"
substitutions:
_PLATFORM: managed
_DEPLOY_REGION: asia-northeast1
_AR_HOSTNAME: asia-northeast1-docker.pkg.dev
_IS_PRODUCTION: "true"
_TRIGGER_ID: "debug"
_SERVICE_NAME: "aipictors"
_SENTRY_AUTH_TOKEN: ""
tags:
- gcp-cloud-build-deploy-cloud-run
- gcp-cloud-build-deploy-cloud-run-managed
- aipictors