我正在尝试在我的持续集成中设置firebase CLI(travis-ci,不是很重要),我不可避免地要登录firebase。
$ firebase login --token FIREBASE_TOKEN --no-localhost
]0;Firebase CLIi Firebase optionally collects CLI usage and error reporting information to help improve our products. Data is collected in accordance with Google's privacy policy (https://policies.google.com/privacy) and is not used to identify you.
? Allow Firebase to collect CLI usage and error reporting information? (Y/n)
由于只是travis-ci,所以没有办法让它回答是或不是这个提示,这就挂起并杀死了构建。
我确实检查了 firebase login
's --help
而这是我得到的。
> firebase login --help
Usage: firebase login [options]
log the CLI into Firebase
Options:
--no-localhost copy and paste a code instead of starting a local server for authentication
--reauth force reauthentication even if already logged in
-h, --help output usage information
所以,似乎没有任何一种覆盖标志,比如: -y
或任何东西。
如果没有办法跳过这个提示,我应该如何在我的连续构建中登录firebase?或者说,如何才能跳过这个提示?
我想这并不复杂,因为对 "CI系统 "的支持概述于 Firebase自己的文档.
编辑:尝试用 login:ci
$ firebase login:ci --token $FIREBASE_TOKEN
]0;Firebase CLI
Visit this URL on this device to log in:
https://accounts.google.com/o/oauth2/auth?client_id=...
Waiting for authentication...
你不需要 firebase login
如果你运行带有 --token
.
$ curl -sL https://firebase.tools | bash
-- Checking for existing firebase-tools on PATH...
-- Checking your machine type...
-- Downloading binary from https://firebase.tools/bin/linux/latest
######################################################################## 100.0%
-- Setting permissions on binary...
-- Checking your PATH variable...
-- firebase-tools@]0;Firebase CLI8.4.1 is now installed
-- All Done!
before_install.2
$ firebase firestore:delete --token $FIREBASE_TOKEN --all-collections --project $PROJECT_ID -y
]0;Firebase CLIDeleting the following collections:
文档中指出你应该使用 login:ci
来直接在命令行中使用 CI 环境提供令牌。 您正在使用 login
,它是为了交互式的外壳。