Firebase-Tools:在尝试通过Angular应用通过Google Cloud Build部署到Firebase时遇到404错误

时间:2019-03-25 22:15:03

标签: angular firebase firebase-hosting firebase-tools google-cloud-build

我最近观看了this视频,内容介绍如何借助Google Cloud Build发布带有firebase-tools项目的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, 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']

0 个答案:

没有答案