Closed anargu closed 2 years ago
Any news on that?
Hi @kozer , I couldn't get a fix on that. What I had to do is modify my solution approach so I don't have to worry about passing env variables. But something useful I got from this issue is that when you use the firebase image and deploy on gcp then the credentials are already passed in to the build, so you don't have to pass the FIREBASE_TOKEN variable. I will close this as there is no new activity here.
I managed to tweak the gcr.io/cloud-builders-community/firebase build image so in theory it should handle custom ENVIRONMENT VARIABLES, so it can be retrieved by the code I implemented to deploy to firebase functions.
When I set the env variable I receive undefined when I receive in my code the process.env.my_var but the script that runs the firebase cli command gets the env var without problems.
In this bash script firebase.sh it does receive the value of process.env.NEXT_PUBLIC_CONFIG:
But, in this block code it does not receive the process.env.NEXT_PUBLIC_CONFIG, it is undefined. This is the first part of the firebase function code I implemented
Part of my cloudbuild.yml is:
I am not sure why this behavior happens, Am I missing something?. Or does firebase cli command does not allow custom env vars?
Affected builder image
gcr.io/cloud-builders-community/firebase (modified, as I explained above)
Expected Behavior
Should read env variable from the code to be submitted to firebase functions
Actual Behavior
process.env.my_var is undefined
Steps to Reproduce the Problem
Additional Info
I don't use a json file in my repository because it is public so this sensible data would be exposed. I didn't use yet the firebase :config set as this is not the pattern I follow with the rest of instances/backend components I already configured.