Google Cloud Build & Firebase Deploy - “An unexpected error has occurred”

孤街浪徒 提交于 2021-02-11 05:54:34

问题


I'm using Google Cloud Build to do a deployment to Firebase Hosting when a commit is on master. I'm using the Firebase Cloud Builder, deployed to my project. I've checked permissions in the Cloud Console and Firebase access is enabled.

Everything seems to go well in generating the static HTML for hosting, but at the final build step it fails suddenly with this problem:

Error: An unexpected error has occurred.

Here is the step in my cloudbuild.yaml that fails:

- name: gcr.io/$PROJECT_ID/firebase
  args: ['deploy', '--project', '$PROJECT_ID']
  id: Deploy to Firebase

回答1:


The last time that I installed the container was in October. The "An unexpected error has occurred" was solved by others by updating their version of the Firebase CLI. I had to do the same thing in my CD environment in order to get this to work.

Following these instructions in the README:

cd cloud-builders-community/firebase
gcloud builds submit --config cloudbuild.yaml .

The Firebase CLI version was reinstalled and published to my project. Then I was able to retry the build and it worked successfully.

This tripped me up for about an hour yesterday, and I thought it may be helpful to just have the answer documented somewhere.



来源:https://stackoverflow.com/questions/60552244/google-cloud-build-firebase-deploy-an-unexpected-error-has-occurred

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!