I have some environment variables declared in a YAML file like:
runtime: python37
env_variables:
API_URL: 'https://fake.api.com/'
API_USERNAME: '[email protected]'
API_PASSWORD: 'Passwooord'
I would like to export these to environment variables with a script, I can echo the correct syntax but I'm still unable to export them.
sed -nr '/env_variables:/,$ s/ ([A-Z_]+): (.*)/\1=\2/ p' app.yaml | while read assign; do echo $assign; done
This is different that this as in my case the variable name is passed trough the pipe as well.