google-app-engine - How do I force Google App Deploy to upload a tgz file of my node app (Meteor) instead of 57K individual files?
问题描述
Have a Meteor application that I’m deploying to a custom flex environment. Deploying same built folder to multiple Google Projects. Usually a .tgz file is created in my local temp folder and then uploaded to the projects default Google bucket and extracted from there to create an App Engine version.
Usually isn’t working for me in one of the projects and instead the gcloud app deploy
command is uploading 57K individual files from node_modules
. This makes a process go from minutes to multiple hours (ran it over night and still not done).‘</p>
I’ve tried reinitializing the gcloud configuration, updating gcloud components, changing the default bucket, but not working. It’s doing some sort of check to see what’s been uploaded because it’ll skip uploaded files if I kill and start again.
解决方案
实现这一目标的一个选项是,使用.gcloudignore
来指示要上传、部署等的文件,或者不。
根据官方文档gcloud 主题 gcloudignore:
gcloud 中的几个命令涉及将目录的内容上传到 Google Cloud Platform 以进行托管或构建。在许多情况下,您不想上传某些文件(即“忽略”它们)。如果顶层目录中有一个名为 .gcloudignore 的文件要上传,它指定的文件将被忽略。
这意味着您可以使用此文件来决定要忽略哪些文件。这样,例如,您可以忽略整个目录或多个目录,这样您的数千个文件就不会被上传。
在下面的这篇文章中,有一些示例说明如何设置此文件以供您自己使用。
让我知道这些信息是否对您有帮助!
推荐阅读
- python - 使用 Confluence Rest API 的响应
- windows - 如何使 Chrome 窗口大小与窗口分辨率一样宽
- azure - Azure AzVMCustomScriptExtension 永远挂起并显示警告消息
- c# - Google 课堂 - 通过别名获取课程
- c# - ASP.net 核心视图不向控制器返回值
- angular - 无法从 localhost:4200 调用 API - Angular
- vb.net - User32 sendmessage 仅适用于某些消息
- java - 如何将具有相同属性的不同注解作为方法参数传递并能够使用该属性?
- javascript - 在 JavaScript 中自动打印
- c++ - 如何在另一个类中创建一个类的实例?