我在Heroku上做了一个程序,它从Dropbox中获取数据,并对其进行处理,得到可用作静态网站的纯.html文件。但是在Heroku上托管不是我想做的事情。我想静态网站上的谷歌AppEngine托管,让赫鲁库管理的过程。
在我本地的PC上,我使用this method在AppEngine上托管静态文件。我如何在Heroku上实现这一点,以便它自动处理源文件并将其发布到AppEngine?这有可能吗?
我使用AppEngine是因为在静态托管中有更好的性能和良好的免费配额。
发布于 2016-10-11 12:27:28
这可以通过使用Google App Engine Admin API来完成。Admin API允许您以编程方式管理应用程序。我假设您正在谈论的是仅部署到单个App Engine应用程序。
您需要遵循的一般流程是:
如果尚未在此project.
1. Set up your authentication with the API. The [docs](https://cloud.google.com/appengine/docs/admin-api/accessing-the-api) here give very generic curl commands, but your flow will differ if you use a service account. Suggest using a [Google Client library](https://cloud.google.com/appengine/docs/admin-api/client-libraries) for your programming language in any case to help.
2. Create a Cloud Storage bucket to hold your staged files for deployment.
3. Write the code that will call the API and point to this Storage bucket and will also create an API representation of the app.yaml configuration file. [Docs](https://cloud.google.com/appengine/docs/admin-api/deploying-apps) are language generic but explain this.
4. [Shift traffic to your newest version of the app](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).
https://stackoverflow.com/questions/39955929
复制相似问题