google-cloud-platform - Google Cloud Build 错误没有项目处于活动状态
问题描述
我正在尝试使用托管在 firebase 上的一个非常简单的项目来设置 Google Cloud Build,但每次它到达部署阶段时它都会告诉我:
Error: No project active, but project aliases are available.
Step #2: Run firebase use <alias> with one of these options:
ERROR: build step 2 "gcr.io/host-test-xxxxx/firebase" failed: step exited with non-zero status: 1
我已将别名设置为生产,我的 .firebasesrc 是:
{
"projects": {
"default": "host-test-xxxxx",
"production": "host-test-xxxxx"
}
我对我的云构建器服务具有 firebase 管理员和 API 密钥管理员权限,并且我也想加密,所以我有 Cloud KMS CryptoKey Decrypter
我愿意
firebase login:ci
在我的终端中生成一个令牌并将其粘贴到我的 .env 变量中,然后生成一个名为 production 的别名并执行
firebase use production
我的yaml是:
steps:
# Install
- name: 'gcr.io/cloud-builders/npm'
args: ['install']
# Build
- name: 'gcr.io/cloud-builders/npm'
args: ['run', 'build']
# Deploy
- name: 'gcr.io/host-test-xxxxx/firebase'
args: ['deploy']
并安装和构建工作正常。这里发生了什么?
重新运行 firebase init 似乎没有帮助。
更新:
在本地构建然后进行 firebase deploy 也无济于事。
解决方案
好的,将 .firebasesrc 文件更改为:
{
"projects": {
"default": "host-test-xxxxx"
}
}
和
firebase use --add
并添加一个名为 default 的别名。
推荐阅读
- java - StackEmptyException 异常问题
- amazon-web-services - 在 AWS EC2 Windows 实例上使用哪个构建服务器和代码扫描工具?
- c# - WriteableBitmap 复制内存泄漏
- php - URL 重写,虚拟子域
- r - 在 r 中打印一个三角形
- python - Tensorflow 中的冻结图
- zxing.net - ZXing.BarcodeReader 代码不解码条码
- mysql - 使用 join Mysql 获取结果
- java - Idea 不断将 Kotlin 的编译目标从 1.8 切换到 1.6
- c - 在 c 中使用 fprintf 写入文件