Use YAML to configure your environment variables in Firebase Functions
npm install firebase-functions-yaml-configUse YAML to configure your environment variables in Firebase Functions
Your configuration file (config.yaml)
``yaml`
default:
hello:
world: Hello, World!
username: $HELLO_USERNAME
password: $HELLO_PASSWORD_ENV
say:
yes: true
ci:
service1:
username: service1-ci
prod:
service1:
username: service1-prod
Configure your CI environment using command:
`bash`
firebase-functions-yaml-config config.yaml ci
which in turn will execute:
`bash`
firebase functions:config:set hello.world='Hello, World!'
firebase functions:config:set hello.username=$HELLO_USERNAME
firebase functions:config:set hello.password=$HELLO_PASSWORD_CI
firebase functions:config:set say.yes=true
firebase functions:config:set service1.username='service1-ci'
------
Then for PROD
`bash`
firebase-functions-yaml-config config.yaml prod
==>
`bash``
firebase functions:config:set hello.world='Hello, World!'
firebase functions:config:set hello.username=$HELLO_USERNAME
firebase functions:config:set hello.password=$HELLO_PASSWORD_PROD
firebase functions:config:set say.yes=true
firebase functions:config:set service1.username='service1-prod'