无法从GCP Cloud Build部署到Firebase托管 [英] Cannot deploy from GCP Cloud Build to Firebase Hosting

查看:57
本文介绍了无法从GCP Cloud Build部署到Firebase托管的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个GCP项目中有一个存储库,其中包含要在Firebase中作为托管应用发布的PWA.我想设置一个触发器,以便每当在分支中执行一次推送时,它就会在Firebase中部署de PWA.我已按照GCP文档部署Firebase ,但我总是收到似乎是授权错误的内容

I have a repo in a GCP project that containes a PWA that I want to publish in Firebase as a hosting app. I want to setup a trigger so whenever a push is done in a branch it deploys de PWA in Firebase. I've followed the steps in GCP documentation Deploy Firebase but I'm always getting what it seems an authorization error

无法获取Firebase项目ghe-dev-repositories-170-920df.请确保该项目存在,并且您的帐户有权访问该项目.

Failed to get Firebase project ghe-dev-repositories-170-920df. Please make sure the project exists and your account has permission to access it.

我已经多次检查是否已启用所有必需的API,并且@ cloudbuild.gserviceaccount.com帐户具有必需的角色.

I have checked several times that all required APIs are enabled and that @cloudbuild.gserviceaccount.com account has the required roles.

我注意到,在创建Firebase项目时,Firebase为该项目提供了一个与GCP项目不同的ID.下面我粘贴cloudbuild.yaml

I have noticed that when creating the Firebase project, Firebase gave the project an Id distinct than the GCP project. Below I'm pasting the cloudbuild.yaml

steps:
  - name: node
    entrypoint: yarn
    args: ["install"]
  - name: gcr.io/cloud-builders/gsutil
    args: ['cp', '${_APP_ENV_PATH}', 'packages/app/.env']
  - name: node
    entrypoint: yarn
    args: ["build"]
  - name: 'gcr.io/${_GCP_PROJECT_ID}/firebase'
    args: ['deploy', '--project=${_TARGET_PROJECT_ID}', '--only=hosting:${_TARGET_ENVIRONMENT}']
timeout: "1600s"

有任何线索吗?

推荐答案

您是否运行过 firebase login:ci 并设置了环境变量 FIREBASE_TOKEN ?

Did you run firebase login:ci and set the environment variable FIREBASE_TOKEN?

请参阅:

这篇关于无法从GCP Cloud Build部署到Firebase托管的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆