[英]Google cloud Appengine standard environment deployment using Admin API: “Cant find import” Error
I am trying to deploy a simple "hello world" application in Appengine standard - Go environment. 我正在尝试在Appengine标准-Go环境中部署一个简单的“ hello world”应用程序。 There is one source file hello.go with one import "google.golang.org/appengine"
有一个源文件hello.go和一个导入文件“ google.golang.org/appengine”
I followed the documentation here to use the Admin API for deployment. 我按照此处的文档使用Admin API进行部署。 But I got "can't find import: google.golang.org/appengine" error when I checked the status of the deployment.
但是当我检查部署状态时,出现“找不到导入:google.golang.org/appengine”错误。
So I uploaded the google.golang.org library folder to Cloud Storage, but documentation seems to only show how to include single files separately from GCS buckets, which is not feasible for big imported libraries. 因此,我将google.golang.org库文件夹上载到了Cloud Storage,但是文档似乎只显示了如何从GCS存储桶中单独包含单个文件,这对于大型导入的库而言是不可行的。
I know all this will work with "gcloud app deploy", but I have to use the Admin API and standard environment. 我知道所有这些都可以与“ gcloud app deploy”一起使用,但是我必须使用Admin API和标准环境。
The deployment works with gcloud because the appengine library is present in your GOPATH. 该部署可与gcloud一起使用,因为您的GOPATH中存在appengine库。 gcloud fetches them from there.
gcloud从那里获取它们。
In the case of the deployment using Admin API, in order to not include one per one all files from your libraries, the packages need to be present in Google Cloud Storage for ZIP deployment or you can use Cloud Source Repositories , build it with the CREATE call and then deploy it from a container with the Cloud Build image. 在使用Admin API进行部署的情况下,为了不包含库中所有文件的一个一个,这些软件包必须存在于Google Cloud Storage中以进行ZIP部署,或者您可以使用Cloud Source Repository ,并使用CREATE进行构建调用 ,然后从带有Cloud Build映像的容器中部署它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.