Sign inSign up

joanfabregat/env2yaml

By joanfabregat

•Updated over 2 years ago

Docker container for conversion of env files to YAML files

Image
0

602

joanfabregat/env2yaml repository overview

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⁠ by l2D⁠.

The source code is available on Github⁠ under the name joanfabregat/env2yaml.

⁠Usage

As a standalone script:

curl -L -o env2yaml.sh https://raw.githubusercontent.com/joanfabregat/env2yaml/main/env2yaml.cjs 
node env2yaml.sh .env env.yaml

In a cloudbuild.yaml⁠ configuration file:

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'

Tag summary

Content type

Image

Digest

sha256:df2e6b4e5…

Size

47.4 MB

Last updated

over 2 years ago

docker pull joanfabregat/env2yaml