-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4bf947
commit 0b56503
Showing
1 changed file
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,39 @@ | ||
# env2yaml | ||
Docker container for conversion of env files to YAML files to be used with Google Cloud Run gcloud CLI | ||
|
||
Docker container for conversion of env files to YAML files to be used with Google Cloud Run gcloud CLI. It is in particular design to be used with GitHub Actions et Google Cloud Build to deploy applications to Google Cloud Run. | ||
|
||
This container is loosely based after [this shell script](https://gist.github.com/l2D/51389881160b2bb9fdafc75277186b84) by [l2D](https://gist.github.com/l2D). | ||
|
||
## Usage | ||
|
||
As a standalone script: | ||
```bash | ||
curl -L -o env2yaml.sh https://raw.githubusercontent.com/joanfabregat/env2yaml/main/env2yaml.cjs | ||
node env2yaml.sh .env env.yaml | ||
``` | ||
|
||
In a [`cloudbuild.yaml`](https://cloud.google.com/build/docs/build-config-file-schema) configuration file: | ||
```yaml | ||
steps: | ||
# Build the container image | ||
- id: 'docker-build' | ||
name: 'gcr.io/cloud-builders/docker' | ||
args: | ||
- 'build' | ||
- '.' | ||
|
||
# Generation of the env.yaml file | ||
- id: 'env2yaml' | ||
name: 'joanfabregat/env2yaml' | ||
env: | ||
- 'INPUT_FILE=/workspace/.env' | ||
- 'OUTPUT_FILE=/workspace/.env.yaml' | ||
|
||
# Deploy container image to Cloud Run | ||
- id: 'deploy-to-cloudrun-staging' | ||
name: 'gcr.io/google.com/cloudsdktool/cloud-sdk' | ||
args: | ||
- 'run' | ||
- 'deploy' | ||
- '--env-vars-file=/workspace/.env.yaml' | ||
``` |