Firebase command line login tools

I am using Codeship to deploy a firebase application. To do this, I first need to log in using the command firebase login. The problem is that I need to go into the browser and then go back to the command line and perform the deployment. Is there an automated way to provide Firebase credentials?

Greetings

+4
source share
4 answers

See wvm2008 answer for a more current version

One option: set a token for the build server and pass it to the CLI using

firebase --token <token>

, :

firebase prefs:token

. .

+1

firebase-, 3. :

firebase login:ci

- , , FIREBASE_TOKEN.

, , ci (.. deploy), :

firebase [command] --token [FIREBASE_TOKEN]
+7

login --no - localhost - , . .

+4

: .

, firebase, firebase login:ci --no-localhost CLI firebase FIREBASE_TOKEN ( $FIREBASE_TOKEN).

npm install -g firebase-tools
firebase deploy

. , ? .

firebase/firebase-tools README : CI-.

Firebase , , CI .

CLI Firebase. firebase login:ci, ( CLI ).

. firebase login:ci --no-localhost

, CI . Firebase :

FIREBASE_TOKEN, . --token <token> CI.

  • 👉 NOTE You MUST put the marker in IIF quotation marks with the --token flag
  • 🔥 👉BIGGER NOTE DO NOT set the environment variable $ or you will receive a minor error message below.

    Your CLI authentication needs to be updated to take advantage of new features. Please run firebase login --reauth

Error: Command requires authentication, please run firebase login

The priority order for loading the token is a flag, an environment , an active project.

👌 The recommendation is to use an environment variable, so the secret token is not saved and is not displayed in the logs.

0
source

Source: https://habr.com/ru/post/1617615/


All Articles