I try to deploy a new version of app engine service with google cloud build with following steps:
- deploy maintenance dispatch.yml to route all requests to maintenance page
- Upgrade database
- deploy new version
- deploy dispatch.yml to route requests back to default service
The first three steps are working, but step 4 results in the following error:
an operation is already in progress
The running GAE process is the one which is stopping the previous version. So how can I find the running process and wait until it is stopped before I deploy the dispatch.yml?
CodePudding user response:
Per the documentation, to migrate traffic from one version to another, you should use the set-traffic
command. So I think your step 4 should be replaced by the set-traffic
command
CodePudding user response:
I could solve the problem by myself with the following statement:
gcloud app operations wait $(gcloud app operations list --format="value(id)" --pending --limit=1) || true
This would wait for a running operation. In my case I had to add this line twice because there where to running operations to wait for.