How to deploy one app engine app to multiple projects

后端 未结 4 1218
我在风中等你
我在风中等你 2021-01-07 02:38

My problem is that I want to create dev, stage, prod environments by using different GCP projects.

Basically they are running

4条回答
  •  北恋
    北恋 (楼主)
    2021-01-07 03:10

    My preference is to have the different environments managed via the same version control as the code - one branch for each environment, keeping the deployments perfectly aligned with the natural flow of code changes, promoted via branch merges: dev -> stage -> production.

    To minimize the risk of human error I try as much as possible to keep the deployment configs in the code itself (i.e. - have the app IDs, versions, etc. picked up from the .yaml files, not passed to the deploy cmd as args). The deployment cmds themselves are kept in a cheat-sheet file (too simple to warrant a full-blown script at this time), also git-controlled. Illustrated in this answer: https://stackoverflow.com/a/34111170/4495081

    Deployments are done from separate, dedicated workspaces - one for each environment, based on the corresponding git branch (I never switch the branches in these workspaces). I just update the workspace corresponding to the desired environment to the version needed and copy-paste the deployment cmd from the workspace's cheat-sheet.

    This model is IMHO CI/CD-ready and can easily be entirely automated.

提交回复
热议问题