Logo

Usage Examples

Google Cloud Functions

gcloud accepts an --env-vars-file argument in YAML form. EnvVault emits exactly that format for both Cloud Functions and App Engine deployments.

Cloud Functions Deploy

envv serverless --platform=gcp -e production -o env.yaml

gcloud functions deploy my-function \
  --runtime=nodejs20 \
  --trigger-http \
  --env-vars-file=env.yaml

App Engine

# Generate the env_variables block
envv serverless --platform=gcp -e production -o env.yaml

# Append to your app.yaml manually, or render at build time:
cat app.template.yaml env.yaml > app.yaml
gcloud app deploy app.yaml

Cloud Build CI

# cloudbuild.yaml
steps:
  - name: 'envvault/cli:latest'
    entrypoint: 'envv'
    args: ['serverless', '--platform=gcp', '-e', 'production', '-o', '/workspace/env.yaml']
    secretEnv: ['ENVVAULT_TOKEN']
  - name: 'gcr.io/cloud-builders/gcloud'
    args: ['functions', 'deploy', 'my-function', '--env-vars-file=/workspace/env.yaml']