Is it possible to set the firebase environment configuration?

tobias_eisenschenk October 29, 2019

I started deploying to firebase from bitbucket pipelines with the atlassian pipe. However i did not see a way to set environment configuration as often necessary:

https://firebase.google.com/docs/functions/config-env

 

Did I miss the docs or do I simply have to use bare bones firebase-tools?

 

Best,

Tobi

2 answers

1 accepted

0 votes
Answer accepted
Viktoriia Kozopas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 17, 2020

Hi @tobias_eisenschenk , 
Currently, the firebase-deploy pipe doesn't have a way to set environment configuration, but we will consider this option in the upcoming pipe releases. 


Thank you for the feedback. We'll notify you about updates.

Cheers,
Viktoriia

0 votes
Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 23, 2020

Hi @tobias_eisenschenk . We're currently considering adding a support for configuring the environment from a pipe. Could you describe your use case a bit more so we can better understand how to improve the pipe? Thanks a lot!

tobias_eisenschenk March 23, 2020

My use case is to deploy firebase cloud-functions along with environment specific configuration (firebase config).

Something like this:

script: 
-
npm --prefix ./functions install
- npm install -g firebase-tools
- firebase use $PROJECT_ID
- firebase functions:config:set environment.database_url=$ENVIRONMENT_DATABASE_URL
- pipe: atlassian/firebase-deploy:0.3.4
variables: FIREBASE_TOKEN: $FIREBASE_TOKEN PROJECT_ID: $PROJECT_ID MESSAGE: "Deploying $BITBUCKET_COMMIT (CI/CD)" EXTRA_ARGS: "--non-interactive --only functions:$FUNCTION_NAME"

As you can see I started using the atlassian pipe, but then had to use the firebase-tools cli as well.

ero_stefano May 2, 2020

@tobias_eisenschenk I came with the idea to set the env in linux: 

script:
- export PROD=false
- pipe: atlassian/firebase-deploy:0.3.8
variables:
FIREBASE_TOKEN: $FIREBASE_TOKEN
PROJECT_ID: $FIREBASE_PROJECT

And then to get it by using node's method:

process.env.PROD 

Actually it didnt work in my code. But probably you will make it.

Ben Calnan September 24, 2020

hi @Alexander Zhukov , just wondering if you were are planning to implement this? Would be super useful to be able to set  functions.config env variables within the pipe using values stored in bitbucket variables.

Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 16, 2020

Hi @Ben Calnan ,

Could you provide us with more details about your case?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events