gcloud app deploy
keeps uploading all files in source directory, although I have explicitly excluded them using a .gcloudignore
file. For example, the virtual environment folder env
is uploaded, which is causing an error because the deployment contains more then 10,000 files then.
I am working under Windows 10 with Python 3.7 and gcloud SDK version 251.0.0. I tried both the beta and the normal version of gcloud app deploy
.
The .gcloudignore
file contains just the following:
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or
# files from your .gitignore file, remove the corresponding line below:
.git
.gitignore
#!include:.gitignore
I can see in the outputs with --verbosity=info
flag that it recognized the .gcloudignore
file, but then it uploads the env
folder to Cloud Storage. I would expect this folder to be skipped. Git works as expected.
You can "include" everything ignored by your .gitignore
file in your .gcloudignore
file by adding the following line:
#!include:.gitignore
If your .gitignore
file is already ignoring the env
directory, this will cause gcloud
to ignore it as well (and every other file that git is ignoring).
Your .gcloudignore file contains two leading spaces on each line which are not allowed.
These spaces are copied from the documentation so many people will be facing this issue. See the documentation here (but do not blindly copy from their until they fixed it)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With