angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

use CI system --token flag on ng deploy

Open yasinkocak opened this issue 6 years ago • 9 comments

**Angular:9.1.11

**Firebase:7.15.4

**AngularFire:6.0.2

For Ci/CD want use Ci system of firebase-tools: https://www.npmjs.com/package/firebase-tools#using-with-ci-systems

ng deploy is not possible to use --token flag

Steps to set up and reproduce

On bitbucket pipeline use --token flag `ng deploy --token= $FIREBASE_TOKEN

Expected behavior

Deploying to firebase hosting,functions

Actual behavior

get error Unknown option: '--token'

yasinkocak avatar Jun 25 '20 06:06 yasinkocak

PR #2525

yasinkocak avatar Jun 26 '20 11:06 yasinkocak

Hello angularFire team. I literally spend a ton of money in your app for my clients. At least answer us. It’s a shame that core features are broken. It’s a shame you don’t manage the PR. At least give us back the projets lead and we can manage it like a TRUE open source project.

BianchiSeb avatar Jul 05 '20 17:07 BianchiSeb

work around:

 npm run build:staging 

 npx firebase deploy --token $npm_package_config_token

configure .firebaserc to use targets

leblancmeneses avatar Sep 07 '20 18:09 leblancmeneses

any progress on this issue?

YogliB avatar Sep 30 '20 12:09 YogliB

This API is now available in 6.1

jamesdaniels avatar Nov 18 '20 16:11 jamesdaniels

After seeing that this was resolved, I tested ng deploy --token {TOKEN} and i still get "Unknown option: '--token'" . What am I doing wrong?

stevebrowndotco avatar Jan 20 '21 14:01 stevebrowndotco

I'm on @angular/fire version 6.1.4 and with ng deploy --token $ACCESS_TOKEN_FIREBASE I'm getting Cannot run login in non-interactive mode. See login:ci to generate a token for use in non-interactive environments.

I've noticed Firebase has changed the way of handling CI for SSR, now the automatically generated in package.json scripts predeploy and deploy aren't that useful. Especially with the new setup for .firebaserc for which I couldn't find any official documentation, just some StackOverflow... Mayday.

danieldanielecki avatar Mar 29 '21 18:03 danieldanielecki

I tried to set FIREBASE_TOKEN env variable before ng deploy command in CICD, now I get below error, while the value I set in FIREBASE_TOKEN was retrieved through firebase login:ci

Cannot run login in non-interactive mode. See login:ci to generate a token for use in non-interactive environments

Update The issue was, I ran sudo ng deploy and for some reasons, it wasn't read the firebase token from env, after removing sudo the issue is resolved

RezaRahmati avatar Apr 25 '21 14:04 RezaRahmati

From @RezaRahmati story, I realized that within FIREBASE_TOKEN env variable, ng deploy can run well (without --token $ACCESS_TOKEN_FIREBASE)

vvvhung avatar Apr 26 '21 08:04 vvvhung