Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
joanfabregat committed Mar 26, 2024
1 parent d4bf947 commit 0b56503
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion README.md
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'
```

0 comments on commit 0b56503

Please sign in to comment.