首页 > 解决方案 > 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.

标签: google-app-enginemeteorgcloud

解决方案


实现这一目标的一个选项是,使用.gcloudignore来指示要上传、部署等的文件,或者不。

根据官方文档gcloud 主题 gcloudignore

gcloud 中的几个命令涉及将目录的内容上传到 Google Cloud Platform 以进行托管或构建。在许多情况下,您不想上传某些文件(即“忽略”它们)。如果顶层目录中有一个名为 .gcloudignore 的文件要上传,它指定的文件将被忽略。

这意味着您可以使用此文件来决定要忽略哪些文件。这样,例如,您可以忽略整个目录或多个目录,这样您的数千个文件就不会被上传。

在下面的这篇文章中,有一些示例说明如何设置此文件以供您自己使用。

让我知道这些信息是否对您有帮助!


推荐阅读