Firebase CLI - 抑制用户提示

Firebase CLI - Suppress User Prompts

我正在通过 firebase-cli 使用 minInstances 参数根据 documentation 部署一个函数。这行得通,但是现在会提示用户确认估计费用:

i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
✔  functions: required API cloudfunctions.googleapis.com is enabled
✔  functions: required API cloudbuild.googleapis.com is enabled
i  functions: preparing . directory for uploading...
i  functions: packaged . (230.66 KB) for uploading
⚠  functions: The following functions have reserved minimum instances. This will reduce the frequency of cold starts but increases the minimum cost. You will be charged for the memory allocation and a fraction of the CPU allocation of instances while they are idle.

    testFunctionInstances(us-central1): 2 instances, 1GB of memory each

With these options, your minimum bill will be .22 in a 30-day month
? Would you like to proceed with deployment? (y/N) 

这个新提示破坏了我们当前的部署设置。我们目前正在考虑使用 firebase-cli 以“香草”状态部署函数,即没有额外的运行时参数,然后使用 gcloud beta 用新的运行时参数更新现有函数的离散列表;然而,这给我们的 CI/CD.

增加了新的复杂性

有没有办法抑制这类与财务估算相关的消息?

相关警告仅在估计价格上涨时出现 - 如果 minInstances 保持稳定,则在单次手动部署后不会出现提示。

也就是说,您可以将 --force 标志添加到部署中,这将抑制所有提示。请注意,这包括提示删除部署中缺少的功能,因此在删除功能时要小心。