I was wondering if there is any way to clone a google app engine project. I could not find any help regarding this, though its quite often one may need this feature. Suppose I started developing an app engine application with so many options / apis configured. Now it would become my staging project and I want a separate project for production. Its never very easy to setup a separate production project with same settings and configurations.
Primarily I would like to make a copy of my staging project for production and make any required changes there.
I had my app code in a git repo, in the
master
branch, from where I used to deploy to a tomy_app
GAE project. Just as you do I wanted a staging environment.So I create a new
my_app-dev
GAE project, which would be the staging environment, with deployments exclusively from themaster
branch.Then I pulled a
production
branch from themaster
branch (effectively a git-controlled copy of the app code) which I now use as the exclusive deployment source for themy_app
(production) GAE project.To reduce the risk of deploying to the wrong app I decided to only deploy by copy-pasting pre-cooked cmds from a
cmds
text file (added to the git repo) in the project dir with the complete commands to deploy the code to the appropriate GAE app. I created this file in themaster
branch, looking like this (I'm using the GAE SDK, not the gcloud one) this:I then merged the file in the
production
branch and updated it for the production GAE app (and added the git cmds to mergemaster
branch changes verified in the staging environment into production):So now I have 2 side-by-side directories for the 2 environments:
my_app-staging
andmy_app-production
, containing git workspaces pulled from themaster
andproduction
branches respectively. I work inmy_app-staging
until I'm happy with the results, then I switch tomy_app-production
and copy-paste the cmds to merge the changes and deploy into production.At any moment I can check the deltas between the staging and the production branches in
my_app-production
(most likely there will be others beside just the GAE app name):Update
On the actual GAE app side I'm not aware of a cloning capability. I cloned my app manually, very early in the development process when there weren't many configs. The need for most config additions/changes came afterwards and I always applied them to both apps.
It might be possible to create such utility using the Google App Engine Admin API. But I didn't use it yet, I don't know if it covers all knobs for a complete cloning process.