【问题标题】:Google Cloud Build error no project active谷歌云构建错误没有项目处于活动状态
【发布时间】: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


    【解决方案1】:

    好的,将 .firebasesrc 文件更改为:

    {
      "projects": {
        "default": "host-test-xxxxx"
      }
    }
    

    和

    firebase use --add
    

    并添加一个名为 default 的别名。

    【讨论】:

      猜你喜欢
      • 2020-11-11
      • 2019-10-31
      • 2021-10-11
      • 2016-10-19
      • 1970-01-01
      • 2011-08-21
      • 1970-01-01
      • 2020-05-11
      • 1970-01-01
      相关资源
      最近更新 更多