I've been trying to figure out if CodeDeploy will respect .gitignore and not zip the files listed within .gitignore as part of the deployment or if CodeDeploy zips the entire repo outside of the .gitignore itself with the --ignore-hidden-files flag? The only info I've been able to find is in [this AWS forum thread from 2015.] (https://forums.aws.amazon.com/thread.jspa?messageID=676492)
I'm using BitBucket Pipelines to kick off CodeDeploy to an On-Premises instance running Windows 2012 R2. There are files not contained in the repo that exist on the server so I don't want CodeDeploy to empty the directory before installing the revision, so I have the --file-exists-behavior OVERWRITE flag on my create-deployment command because otherwise CodeDeploy fails when a file already exists.
I've been able to deploy other repos to this instance successfully. However with this current repo every attempted deployment has failed with an 'UnknownError' error code and the message is: Permission denied @ rb_sysopen - e:/www/path/to/the/file.db. I had seen some people saying that the file could be in use by another program but I couldn't find anything using a file named file.db. I tried adding file.db to .gitignore but it looks like it's still getting put in the zip file that CodeDeploy is using to update the instance.