How to use GAE's dispatch.yaml with multiple development environments?

前端 未结 3 479
清歌不尽
清歌不尽 2020-12-19 15:44

I am trying to understand the dispatch.yaml file for Google App Engine.

We have a vanilla web app with a frontend and a backend. We also have a develop

3条回答
  •  不知归路
    2020-12-19 16:20

    I also had the same problem as you and I come to offer you a 3rd solution. If you have several development environments, you may have an automatic deployment (for my part, with Gitlab-CI). I proceed as follows during my deployment internship, I copy (or rename) the dispatch file:

    • Testing: ./gcp.dispatch.testing.yml => ./dispatch.yml
    • Production: ./gcp.dispatch.production.yml => ./dispatch.yml

    Here is an example of a stage from my gitlab-ci.yml file (for testing):

    testing__deploy__gcp_dispatch:
      stage: dispatch
      image: google/cloud-sdk:alpine
      script:
        - cd ${CI_PROJECT_DIR}
        - gcloud auth activate-service-account --key-file ${GCP_SERVICE_KEY_FILE}
        - cp ./gcp.dispatch.testing.yml ./dispatch.yml
        - gcloud --quiet --project ${GCP_PROJECT_ID} app deploy ./dispatch.yml
    

    There you go !

    PS: I understood that after, where the error Unexpected attribute 'dispatch' for object of type AppInfoExternal. came from. gcloud does not accept that the file is named differently than dispatch.yml...

提交回复
热议问题