Firebase-tools: ошибка 404 при попытке развернуть Firebase через Google Cloud Build с приложением Angular - PullRequest
3 голосов
/ 26 марта 2019

Недавно я смотрел это видео о том, как опубликовать приложение Angular с проектом firebase-tools с помощью Google Cloud Build.

Таким образом, триггер сборки работает, но он всегда не может завершить последний шаг, который заключается в развертывании проекта в 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"
  }
}

и облачный билд.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']
...