23

I'm having trouble deploying travis CI with firebase using these firebase commands:

firebase deploy --email ${FIREBASE_USERNAME} --password ${FIREBASE_PASSWORD}
firebase deploy --token ${FIREBASE_TOKEN}

It does not like --email option and it does seem that it takes --token but does not work with my firebase auth token I can get from my firebase app. What am I doing wrong?

jhlosin
  • 555
  • 1
  • 6
  • 17
  • found this https://www.npmjs.com/package/firebase-tools. maybe the token I had is not the right one. I am doing a test now agian. – jhlosin Dec 10 '15 at 03:36

2 Answers2

66

The email option was removed in the 2.0 release of the CLI.

Use firebase login:ci to generate a token.

  1. On a machine with a browser, install the Firebase CLI.
  2. Run firebase login:ci to log in and print out a new access token (the current CLI session will not be affected).
  3. Store the output token in a secure but accessible way in your CI system.
David East
  • 31,526
  • 6
  • 67
  • 82
0

Another firebase deployment option in travis-ci is to use dpl (https://github.com/travis-ci/dpl) which is a deployment provider

OPTIONS

  • token: Your Firebase CI Access Token (generated from firebase login:ci)
  • project: Deloy to a different Firebase Project than specified in firebase.json
  • public: Specifies which directory to upload to Firebase Hosting.
  • ignore: Specifies the files to ignore on deploy. (similar to .gitignore)

EXAMPLE

dpl --provider=firebase --token=<token> --project=<project>

What is really cool about using this deployment provider utility is that you can deploy to one or more firebase hosted applications from a single project commit...

after_script:
  - dpl --provider=firebase --token=${FIREBASE_TOKEN} --project=${PROJECT_ONE}
  - dpl --provider=firebase --token=${FIREBASE_TOKEN} --project=${PROJECT_TWO}

References:

Note: One thing you will need to consider is how you set FIREBASE_URL as a constant in each hosted application if they need to use the same code base but a separate Firebase for storing data.

KnownTraveler
  • 349
  • 2
  • 12
  • 1
    I have 5 firebase projects that have the same code, can I update all 5 projects from single GitHub repo from Travis?? and that FIREBASE_TOKEN is unique or I need for every project to generate tokens? – George C. May 20 '17 at 14:12
  • that PROJECT_ONE you say what is ? the name of my firebase project the URL of that project ?? – George C. May 20 '17 at 14:15
  • I'm getting ⚠ Your CLI authentication needs to be updated to take advantage of new features. ⚠ Please run firebase login --reauth – netshark1000 Nov 18 '17 at 10:07