简体   繁体   English

如何从 App Engine 中的云 shell 部署 GCS 中我的应用程序存储桶中的文件?

[英]How do I deploy the files from my app bucket in GCS from cloud shell in App engine?

I am trying to create my first php app using GCS.我正在尝试使用 GCS 创建我的第一个 php 应用程序。

I have placed all my php app files in the bucket (including my.yaml file) created by the app engine, but I am struggling to access the files to deploy the app using the cloud shell in app engine?我已将所有 php 应用程序文件放在应用程序引擎创建的存储桶中(包括 my.yaml 文件),但我很难访问文件以使用云 Z2591C98B70119FE624898B1E424 中的应用程序部署应用程序?

If I has them stored in git I would have used the clone commands but would assume that this would have placed the files in the same bucket that I have manually uploaded the files to through the bucket browser?!如果我将它们存储在 git 中,我会使用克隆命令,但会假设这会将文件放在我通过存储桶浏览器手动上传文件的同一存储桶中?!

I either cant find the correct file path as the buckets do not appear to be part of my /home/username directory or I am missing a key link like an API to the cloud storage service (GSUtil?).我要么找不到正确的文件路径,因为存储桶似乎不是我的 /home/username 目录的一部分,要么我缺少一个关键链接,如 API 到云存储服务(GSUtil?)。

Can anyone point me in the right direction?谁能指出我正确的方向?

JH JH

You shouldn't be manually placing any files into the (app's staging) GCS bucket yourself to deploy an app to app engine.您不应该自己手动将任何文件放入(应用程序的暂存)GCS 存储桶以将应用程序部署到应用程序引擎。

Instead, place the files (including your app.yaml ) in a working directory on your machine (or cloud shell), then use the gcloud app deploy command to deploy them.相反,将文件(包括您的app.yaml )放在您机器(或云外壳)上的工作目录中,然后使用gcloud app deploy命令部署它们。 You can see an example of how to deploy a PHP app here .您可以在此处查看如何部署 PHP 应用程序的示例。 The gcloud app deploy command is going to look for the source files on the local filesystem. gcloud app deploy命令将在本地文件系统上查找源文件。

Note that using git isn't a requirement (though using some form of source control is always a good development practice), it is just the way the files are copied onto the local machine in this example.请注意,使用 git 不是必需的(尽管使用某种形式的源代码控制始终是一种很好的开发实践),这只是在此示例中将文件复制到本地计算机的方式。

(Likewise -- GCS buckets won't show up in the cloud shell filesystem -- GCS is a blob storage service not a normal filesystem, so you would need to use a tool like gsutil or the GCS API to access it). (同样——GCS 存储桶不会出现在云 shell 文件系统中——GCS 是一种 blob 存储服务而不是普通文件系统,因此您需要使用像gsutilGCS API这样的工具来访问它)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我无法从 App Engine 将任何文件上传到 GCS 中的存储桶,但我可以使用 php 从本地服务器编码 - I can't upload any file to bucket in GCS from App Engine, but I can from my local server coding with php 如何通过Google App Engine PHP脚本连接到Google Cloud Storage? - How do I connect to Google Cloud Storage from a Google App Engine PHP script? 将配置文件从Google Cloud Storage提取到App Engine Standard时,我有哪些选择? - What are my options to pull configuration files from Google Cloud Storage to App Engine Standard? 通过App Engine从Google Cloud Storage提供文件的上限? - Caps on serving files from Google Cloud Storage via App Engine? 我可以从不是Google App Engine的网站上编写/读取Google Cloud Storage吗? - Can I write/read Google Cloud Storage from my website which is not a Google App Engine? 如何将php应用程序从本地计算机部署到Google App Engine - How to deploy a php application from local machine to google app engine 如何使用谷歌应用引擎将 php 项目部署到谷歌云中? - How to deploy php project into google cloud using google app engine? 如何从 App Engine 连接到 Cloud SQL MySQL 数据库? - How to connect to Cloud SQL MySQL database from App Engine? 从App Engine连接到Cloud SQL无法正常工作 - Connecting from App Engine to Cloud SQL not working 如何在本地主机上为本地应用引擎启动器模拟默认存储桶? - How do I simulate the default Bucket for local app engine launcher on localhost?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM