How can I exclude a file from deploy in gcloud?

iuliu.net picture iuliu.net · Apr 20, 2016 · Viewed 10.2k times · Source

I have built a Node.js app and what I do to deploy is cd into my project's directory and run gcloud preview app deploy. This works, but in the files I also have a JSON file which acts like the database for my application, which I do not want updated on the site when I deploy. I cannot seem to find any way of doing this. If it's not possible, being able to see the JSON file remotely and copy its data to the local one and then deploy everything would do me too, but I cannot seem to be able to do that either.

Answer

Michael McCoy picture Michael McCoy · Mar 13, 2017

I believe you will want to use the skip_files directive in your app.yaml to exclude paths or files you do not want deployed.

Something like:

skip_files:
  - ^your_data_dir/.*\.json?