How do I deploy to GAE from the Google Cloud Source Repository?

谁说我不能喝 提交于 2019-12-11 02:38:10

问题


I'm considering moving my php Google App Engine project from Codenvy to the Google Source Repository and edit it there with the Source Editor, but I don't see how to cause it to deploy my project. How do I do that?


回答1:


Here's what works for me, found through guesswork, trial, error, Billy and only a little docs.

I had set up GC Repositories to have a repository which is a mirror to bitbucket , auto-named default. Note: gcloud for default below can fail to recognise a repository that got that name by Rename. And can mistake a non-existent repository for an empty one.

Recipe 1

UPDATE: Now, after updating the bitbucket source, the deployed app does not show the update, despite "Deployment successful"]4. I don't know why - perhaps due to version number. Workaround: Use Recipe 2.

1 Ensure project's app.yaml file contains application: and version: e.g. this

2 Go to Google Cloud Patform and select the project

3 Click Activate Google Cloud Shell http://i.imgur.com/Axjy17q.png

4 In Google Cloud Shell, enter:

gcloud source repos clone default
appcfg.py update default
rm -rf default

This took ~20s to deploy and ~30s to complete.

Recipe 2

1 Ensure project's app.yaml file does not contain application: or version: (else you'll get an error like this) e.g. this

2 Go to Google Cloud Patform and select the project

3 Click Activate Google Cloud Shell http://i.imgur.com/Axjy17q.png

4 In Google Cloud Shell enter:

gcloud source repos clone default
gcloud --quiet app deploy default/app.yaml
rm -rf default

Warning: This can leave a previous version accessible.

This took ~65s to complete.

Re timing, compare this, taking ~20s . Timings are for a Hello World project.



来源:https://stackoverflow.com/questions/37171916/how-do-i-deploy-to-gae-from-the-google-cloud-source-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!