How to automatically delete old instances of the version of the Google App Engine application?

I am experimenting with more economical ways to deploy Rails applications and go through Ruby Starter Projects to get a feel for the Google Cloud Platform.

It is almost perfect and certainly competitive in price, but I cannot figure out how to automatically delete old deployed version instances after redistribution.

ie: let's say I have one version of each instance:

Compute Engine -> VM Instances

And then I make changes to my application and relocate with:

$ gcloud preview app deploy app.yaml worker.yaml --promote

So now I have two versions of each deployed instance (since Google switches between them wisely, I would suggest):

Compute Engine -> VM instances double

? - ? , , - :

Versions. , .

appengine / versions

Google App Engine ?

+4
3

- ( , ), control, Python, API modules:

from google.appengine.api.modules import modules

# core logic (inside a cron or other handler)
for m in modules.get_modules():
    dv = modules.get_default_version(m)
    for v in modules.get_versions(m):
        if v != dv: modules.stop_version(m, v)

(API modules ), , ( ).

, , , , cron "" , ( auth) wget curl bash.

, Ruby Python google.appengine.api.modules.modules, ... . Python- , App Engine ( App Engine , ).

+6

, , ( ), doc

, Ruby on Compute Engine, .

, , !

, , . , Google , , .

0
0

Source: https://habr.com/ru/post/1622008/


All Articles