Skip to content

Commit

Permalink
📝 Fix deploy with env typo (#43)
Browse files Browse the repository at this point in the history
* 📝 Fix deploy with env typo

* 📝 Fix deploy with env typo

* 📝 Fix deploy with env typo
  • Loading branch information
zatonix authored Aug 5, 2024
1 parent 5be8103 commit 51d997c
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions app/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ steps:
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', 'gs://ctm-environment-prod/app/.env', '.env']

- name: 'environment variables'
entrypoint: '/bin/sh'
args:
- '-c'
- |
export $(grep -v '^#' .env | xargs) && \
ENV_VARS=$(grep -v '^#' .env | xargs | sed 's/ /,/g') && \
echo $ENV_VARS > /workspace/env_vars.txt
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/chess-tactics-manager-app', '-f', './Dockerfile', '..']
dir: 'app'
Expand All @@ -23,14 +14,13 @@ steps:
args:
- '-c'
- |
ENV_VARS=$(cat /workspace/env_vars.txt) && \
gcloud run deploy chess-tactics-manager-app \
--image gcr.io/$PROJECT_ID/chess-tactics-manager-app \
--platform managed \
--region europe-west1 \
--allow-unauthenticated \
--port 8080 \
--set-env-vars $ENV_VARS
--set-env-vars=$(tr -d '\n' < .env)
images:
- 'gcr.io/$PROJECT_ID/chess-tactics-manager-app'
Expand Down

0 comments on commit 51d997c

Please sign in to comment.