-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
147 lines (140 loc) · 4.52 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
steps:
- name: 'gcr.io/cloud-builders/npm'
id: CreateEnv
args: ['run', 'create-env']
env:
- BUN_ENV=${_BUN_ENV}
- ALCHEMY_API_KEY=${_ALCHEMY_API_KEY}
- INFURA_API_KEY=${_INFURA_API_KEY}
- MONGO_URI=${_MONGO_URI}
- THIRDWEB_CLIENT_ID=${_THIRDWEB_CLIENT_ID}
- THIRDWEB_CLIENT_SECRET=${_THIRDWEB_CLIENT_SECRET}
- PINATA_JWT=${_PINATA_JWT}
- GATEWAY_URL=${_GATEWAY_URL}
- ICP_CANISTER_ID=${_ICP_CANISTER_ID}
- ICP_MNEMONIC=${_ICP_MNEMONIC}
- BOT_API_URL=${_BOT_API_URL}
- BOT_DATA_TOKEN=${_BOT_DATA_TOKEN}
- NFT_UPLOAD_IMAGE_ICP=${_NFT_UPLOAD_IMAGE_ICP}
- NFT_UPLOAD_IMAGE_IPFS=${_NFT_UPLOAD_IMAGE_IPFS}
- GCP_BUCKET_BASE_URL=${_GCP_BUCKET_BASE_URL}
- PUSH_CHANNEL_ADDRESS=${_PUSH_CHANNEL_ADDRESS}
- PUSH_CHANNEL_PRIVATE_KEY=${_PUSH_CHANNEL_PRIVATE_KEY}
secretEnv: [
'CHATIZALO_TOKEN',
'FRONTEND_TOKEN',
'PRIVATE_KEY',
'SIGNING_KEY'
]
- name: 'gcr.io/cloud-builders/docker'
id: Build
args: [
'build',
'--no-cache',
'-t',
'$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA',
'-f',
'Dockerfile',
'--build-arg',
'BUN_ENV=${_BUN_ENV}',
'--build-arg',
'ALCHEMY_API_KEY=${_ALCHEMY_API_KEY}',
'--build-arg',
'INFURA_API_KEY=${_INFURA_API_KEY}',
'--build-arg',
'MONGO_URI=${_MONGO_URI}',
'--build-arg',
'THIRDWEB_CLIENT_ID=${_THIRDWEB_CLIENT_ID}',
'--build-arg',
'THIRDWEB_CLIENT_SECRET=${_THIRDWEB_CLIENT_SECRET}',
'--build-arg',
'PRIVATE_KEY=$$PRIVATE_KEY',
'--build-arg',
'SIGNING_KEY=$$SIGNING_KEY',
'--build-arg',
'PINATA_JWT=${_PINATA_JWT}',
'--build-arg',
'GATEWAY_URL=${_GATEWAY_URL}',
'--build-arg',
'ICP_CANISTER_ID=${_ICP_CANISTER_ID}',
'--build-arg',
'ICP_MNEMONIC=${_ICP_MNEMONIC}',
'--build-arg',
'BOT_API_URL=${_BOT_API_URL}',
'--build-arg',
'BOT_DATA_TOKEN=${_BOT_DATA_TOKEN}',
'--build-arg',
'NFT_UPLOAD_IMAGE_ICP=${_NFT_UPLOAD_IMAGE_ICP}',
'--build-arg',
'NFT_UPLOAD_IMAGE_IPFS=${_NFT_UPLOAD_IMAGE_IPFS}',
'--build-arg',
'GCP_BUCKET_BASE_URL=${_GCP_BUCKET_BASE_URL}',
'--build-arg',
'ARBITRUM_SEPOLIA_RPC_URL=${_ARBITRUM_SEPOLIA_RPC_URL}',
'--build-arg',
'CHATIZALO_TOKEN=$$CHATIZALO_TOKEN',
'--build-arg',
'FRONTEND_TOKEN=$$FRONTEND_TOKEN',
'--build-arg',
'PUSH_CHANNEL_ADDRESS=${_PUSH_CHANNEL_ADDRESS}',
'--build-arg',
'PUSH_CHANNEL_PRIVATE_KEY=$$PUSH_CHANNEL_PRIVATE_KEY',
'.'
]
secretEnv: [
'CHATIZALO_TOKEN',
'FRONTEND_TOKEN',
'PRIVATE_KEY',
'SIGNING_KEY'
]
- name: 'gcr.io/cloud-builders/docker'
id: Push
args: [
'push',
'$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA',
]
- name: 'gcr.io/cloud-builders/gcloud'
id: Deploy
entrypoint: gcloud
args: [
'run',
'deploy',
'$_SERVICE_NAME',
'--platform',
'managed',
'--region',
'$_DEPLOY_REGION',
'--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',
'--quiet',
'--allow-unauthenticated'
]
- name: "bash"
script: |
#!/usr/bin/env bash
echo "CHATIZALO_TOKEN en cloudbuild.yaml 1: $CHATIZALO_TOKEN"
echo "FRONTEND_TOKEN en cloudbuild.yaml 2: $FRONTEND_TOKEN"
echo "PRIVATE_KEY en cloudbuild.yaml 3: $PRIVATE_KEY"
echo "SIGNING_KEY en cloudbuild.yaml 4: $SIGNING_KEY"
secretEnv: [
'CHATIZALO_TOKEN',
'FRONTEND_TOKEN',
'PRIVATE_KEY',
'SIGNING_KEY'
]
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/${_CHATIZALO_TOKEN_SECRET_NAME}/versions/latest
env: 'CHATIZALO_TOKEN'
- versionName: projects/$PROJECT_ID/secrets/${_FRONTEND_TOKEN_SECRET_NAME}/versions/latest
env: 'FRONTEND_TOKEN'
- versionName: projects/$PROJECT_ID/secrets/${_PRIVATE_KEY_SECRET_NAME}/versions/latest
env: 'PRIVATE_KEY'
- versionName: projects/$PROJECT_ID/secrets/${_SIGNING_KEY_SECRET_NAME}/versions/latest
env: 'SIGNING_KEY'
images:
- $_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
options:
logging: CLOUD_LOGGING_ONLY