Firebase 部署功能 -- 非交互式

iMD*_*oid 6 firebase google-cloud-functions google-cloud-firestore firebase-cli

我正在集成 CI/CD 以部署我的 firebase 功能。

firebase use PROJECTID --token FIREBASE_TOKEN
firebase deploy --token FIREBASE_TOKEN --non-interactive
Run Code Online (Sandbox Code Playgroud)

现在,每当从 index.js 中删除一个函数时,它都会抛出以下异常。

错误:在您的项目中找到以下函数,但在您的本地源代码中不存在:httpSeeding(us-central1) 正在中止,因为删除无法在非交互模式下进行。要修复,请通过运行手动删除函数:firebase functions:delete httpSeding --region us-central1

在非交互模式下有没有办法在不运行的情况下从控制台中删除已删除的功能 firebase functions:delete httpSeeding

Jai*_*eri 8

使用-f选项运行 deploy ,它应该在非交互模式下删除额外的功能

firebase deploy --token FIREBASE_TOKEN -f

从运行可用的文档中firebase help deploy,我们看到以下选项:

 -f, --force delete Cloud Functions missing from the current working directory without confirmation
Run Code Online (Sandbox Code Playgroud)


Dou*_*son 1

只需从 shell 运行相同的部署命令即可。它将自动删除源中缺少的功能。

您还可以直接从 Cloud 控制台删除函数。