Reputation: 4619
Configuring different versions of the same service differently in GAE Standard
I deploy multiple versions of the same service and want them to be configured differently. For example, the test
version of a service should run on lower-spec instances (& no idle instances) than the prod
version of the same service.
Since both deployments share the same appengine-web.xml
, how do I maintain & use different versions of this configuration file?
On an earlier project I had resorted to having separate appengine-web.xml.test
and appengine-web.xml.prod
versions in Git (appengine-web.xml
itself was .gitignore
-d). Then I wrote a simple build program which would overwrite appengine-web.xml
with the appropriate version, then run the build and deployment commands. This was using the AppEngine SDK.
On my current project I am using the GCloud SDK. Is a better/simpler solution possible?
Upvotes: 0
Views: 332
Reputation: 39824
From the deployment perspective different versions of the same service do not technically share the appengine-web.xml
file, they each have their own copy of the file reflecting the content of the local file version at the time the respective version was deployed. The very version
of the service itself can actually be configured in the file, in case you have doubts.
So it's really up to you how you manage the file versioning in the workspace/repository from where you're deploying the service.
You earlier script is one way of doing it.
Another possibility would be to have different versions of the file in different, per-environment branches. A more detailed description can be found in this post (it's about app.yaml
, it's true, but it's the same general idea): Google Cloud App Engine app.yaml for multiple environments
Side note: personally I'd suggest using different applications to implement different environments, not just different versions and/or services, see:
Upvotes: 2