How to automatically change default version on app engine instance

48 views
Skip to first unread message

Jingyi Li

unread,
Jan 28, 2015, 3:36:14 PM1/28/15
to google-a...@googlegroups.com
Hi,

I'm working on a task to nightly build our project and deploy it to app engine instance. Right now, every time we deployed, we had to manually change the default version on app engine instance. Is there a way to automatically change the default version to the latest one that is deployed?


Thanks,
Jingyi

Alex Martelli

unread,
Jan 28, 2015, 7:08:19 PM1/28/15
to google-a...@googlegroups.com
On Wednesday, January 28, 2015 at 12:36:14 PM UTC-8, Jingyi Li wrote:
Hi,

I'm working on a task to nightly build our project and deploy it to app engine instance. Right now, every time we deployed, we had to manually change the default version on app engine instance. Is there a way to automatically change the default version to the latest one that is deployed?

As long as you don't change index.yaml (which requires a delay for index rebuilding and thus would make it an error to "automatically change the default version to the latest one that is deployed") you could use a a 2-line shell script or the like:

    appcfg.py <options> update yourapp/
    appcfg.py <options> set_default_version yourapp/

The latter uses the version set in yourapp/app.yaml; if that's not good for you, use the --version flag.

If you do want to update index.yaml, I don't know of a reliable way to check when the index is done re-building in a fully automated way (as opposed to manually checking the "Indexes" section of the Admin Console).

If you're using `gcloud`, I think 

    gcloud preview app modules set-default default

(again possibly with a `--version` flag) is the equivalent of appcfg's set_default_version.  You can set default version on other modules too of course -- the last arg (of which you can have several) says which modules you want to affect.

But the index-rebuilding-delay problem, to the best of my knowledge, doesn't go away by moving from appcfg to gcloud...


Alex

Reply all
Reply to author
Forward
0 new messages