【发布时间】:2020-09-21 11:29:59
【问题描述】:
我正在尝试使用托管在 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 Keys 管理员权限,并且我还想加密,因此我拥有 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 部署也无济于事。
【问题讨论】:
标签: google-cloud-platform firebase-hosting google-cloud-build