use*_*337 7 deployment google-app-engine go gcloud
我有一个使用"github.com/gorilla/mux"的应用程序,我可以使用它进行部署goapp deploy.但我不能这样做gcloud preview app deploy因为我遇到这个错误:
Beginning deployment...
Copying files to Google Cloud Storage...
Synchronizing files to [<googlecloudsdk.api_lib.app.cloud_storage.BucketReference object at 0x10514e790>].
File upload done.
Updating module [api]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [9] Deployment contains files that cannot be compiled: Compile failed:
2016/03/22 09:06:40 go-app-builder: build timing: 1×6g (42ms total), 0×6l (0 total)
2016/03/22 09:06:40 go-app-builder: failed running 6g: exit status 1
api.go:29: can't find import: "github.com/gorilla/handlers"
Run Code Online (Sandbox Code Playgroud)
我希望能够这样做,因为我需要在合并时从travisCI部署,我想使用service-client.json进行授权.
它有什么办法吗?
要直接回答您的问题,解决此问题的方法是goapp deploy按照 Go 标准环境的 App Engine 文档的建议使用部署 Go 应用程序。当时gcloud preview app deploy推出时,推荐使用 goapp 正是为了处理 go 的特定环境和依赖要求。
或者,如果您想使用gcloud,则需要gcloud app deploy立即使用。 自 2016 年 6 月 29 日起gcloud preview app deploy已被弃用和/或删除。