Firebase工具:尝试通过Google Cloud Build和Angular应用程序部署到Firebase时出现404错误
我最近看了一段视频,内容是关于如何在Google Cloud Build的帮助下发布一个带有firebase工具的Angular应用程序项目 因此,构建触发器正在工作,但它总是无法完成最后一步,即将项目部署到firebase 上一步的日志:Firebase工具:尝试通过Google Cloud Build和Angular应用程序部署到Firebase时出现404错误,angular,firebase,firebase-hosting,firebase-tools,google-cloud-build,Angular,Firebase,Firebase Hosting,Firebase Tools,Google Cloud Build,我最近看了一段视频,内容是关于如何在Google Cloud Build的帮助下发布一个带有firebase工具的Angular应用程序项目 因此,构建触发器正在工作,但它总是无法完成最后一步,即将项目部署到firebase 上一步的日志: ERROR: build step 4 "gcr.io/(PROJECT_ID)/firebase" failed: exit status 1 ERROR Finished Step #4 Step #4: Error: HTTP Error: 404,
ERROR: build step 4 "gcr.io/(PROJECT_ID)/firebase" failed: exit status 1
ERROR
Finished Step #4
Step #4: Error: HTTP Error: 404, Method not found.
Step #4:
Step #4: i functions: ensuring necessary APIs are enabled...
Step #4: ✔ firestore: rules file firestore.rules compiled successfully
Step #4: i firestore: reading indexes from firestore.indexes.json...
Step #4: i firestore: checking firestore.rules for compilation errors...
Step #4: ✔ storage: rules file storage.rules compiled successfully
Step #4: i storage: checking storage.rules for compilation errors...
Step #4: ✔ functions: Finished running predeploy script.
Step #4:
Step #4: > tsc
Step #4: > functions@ build /workspace/functions
Step #4:
Step #4: Running command: npm --prefix "$RESOURCE_DIR" run build
Step #4:
Step #4: > tslint --project tsconfig.json
Step #4: > functions@ lint /workspace/functions
Step #4:
Step #4: Running command: npm --prefix "$RESOURCE_DIR" run lint
Step #4: i deploying storage, firestore, functions, hosting
Step #4:
Step #4: === Deploying to '(PROJECT_ID)'...
Step #4:
Step #4: Already have image (with digest): gcr.io/(PROJECT_ID)/firebase
Starting Step #4
我的firebase.json文件:
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
],
"source": "functions"
},
"hosting": {
"public": "dist/airoc-ui-module-test",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"storage": {
"rules": "storage.rules"
}
}
还有cloudbuild.yaml
steps:
#Install root
- name: 'gcr.io/cloud-builders/npm'
args: ['install']
#Install functions
- name: 'gcr.io/cloud-builders/npm'
args: ['install']
dir: 'functions/'
#Build
- name: 'gcr.io/cloud-builders/npm'
args: ['run', 'build']
#Deploy
- name: 'gcr.io/$PROJECT_ID/firebase'
args: ['deploy']
请看下一页我的答案@zkohi你的答案与403有关。这可能与OP正在经历的404有所不同。@bygrace我知道。我只是在有帮助的情况下以示例的形式展示了我的设置方式。对我来说,它最终与权限相关(404是误导性的)。授予Firebase admin云构建服务帐户允许我部署托管和firestore,但我得到了404的功能。如果您使用ci令牌,那么它可以工作。