-
Notifications
You must be signed in to change notification settings - Fork 17
/
cloudbuild.yaml
37 lines (35 loc) · 1.86 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
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
args: [
'build', '-t',
'gcr.io/${PROJECT_ID}/${_SERVICE_NAME}:${COMMIT_SHA}',
'--build-arg=ENV_TAG=${_ENV_TAG}',
'.',
]
# Push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/${PROJECT_ID}/${_SERVICE_NAME}:${COMMIT_SHA}']
# Deploy container image to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- '${_SERVICE_NAME}'
- '--image=gcr.io/${PROJECT_ID}/${_SERVICE_NAME}:${COMMIT_SHA}'
- '--region=us-east1'
- '--allow-unauthenticated'
- '--port=9999'
- '--cpu=2'
- '--memory=1Gi'
- '--min-instances=1'
- '--max-instances=30'
- '--concurrency=50'
- '--set-env-vars=SERVER_HOST=${_SERVER_HOST},SERVER_ORIGINS=${_SERVER_ORIGINS},TENDERLY_DEFAULT_MAINNET_FORK_ID=${_TENDERLY_DEFAULT_MAINNET_FORK_ID},TENDERLY_PROJECT_API_BASE_URL=${_TENDERLY_PROJECT_API_BASE_URL},TENDERLY_DASHBOARD_PROJECT_BASE_URL=${_TENDERLY_DASHBOARD_PROJECT_BASE_URL},WEAVIATE_URL=${_WEAVIATE_URL}'
- '--set-secrets=SERVER_SECRET_KEY=${_ENV_TAG}_SERVER_SECRET_KEY:latest,CHATDB_URL=${_ENV_TAG}_CHATDB_URL:latest,SCRAPEDB_URL=${_ENV_TAG}_SCRAPEDB_URL:latest,TENDERLY_API_KEY=${_ENV_TAG}_TENDERLY_API_KEY:latest,OPENAI_API_KEY=${_ENV_TAG}_OPENAI_API_KEY:latest,HUGGINGFACE_API_KEY=${_ENV_TAG}_HUGGINGFACE_API_KEY:latest,OPENSEA_API_KEY=${_ENV_TAG}_OPENSEA_API_KEY:latest,CENTER_API_KEY=${_ENV_TAG}_CENTER_API_KEY:latest,ETHERSCAN_API_KEY=${_ENV_TAG}_ETHERSCAN_API_KEY:latest,ALCHEMY_API_KEY=${_ENV_TAG}_ALCHEMY_API_KEY:latest,WEAVIATE_API_KEY=${_ENV_TAG}_WEAVIATE_API_KEY:latest'
- '--vpc-connector=chatweb3'
# _SERVICE_NAME and _ENV_TAG are custom substitutions defined within
# the GCP Cloud Build triggers
images:
- 'gcr.io/${PROJECT_ID}/${_SERVICE_NAME}:${COMMIT_SHA}'