Problem
When using s3 sync, we can include/exclude objects for the sync using --exclude <pattern> and --include <pattern>. This can be cumbersome if someone has to deal with many patterns at once.
Proposed solution
I'd suggest to implement two additional options: --exclude-file <filename> and --include-file <filename> so we would be able to specify files which contain lists of patterns. See how rsync does it here. Implementing it in the same way as rsync does would have the benefit of maintaining one list for both.
Additional selling point: the exclude file can be managed in git without tampering with CI scripts.
Example usage
Now
aws s3 sync . s3://bucket/html/ --exclude=".*" --exclude "license/*" --exclude "LICENSE.md" --exclude "*.map" --exclude "*.scss" --exclude "customVariables.css" --exclude "css/bootstrap/*"
With proposed feature
aws s3 sync . s3://bucket/html/ --exclude-file .syncignore
Alternatives I have considered
None really. The only alternative I know of is using many single statements.
Problem
When using
s3 sync, we can include/exclude objects for the sync using--exclude <pattern>and--include <pattern>. This can be cumbersome if someone has to deal with many patterns at once.Proposed solution
I'd suggest to implement two additional options:
--exclude-file <filename>and--include-file <filename>so we would be able to specify files which contain lists of patterns. See howrsyncdoes it here. Implementing it in the same way asrsyncdoes would have the benefit of maintaining one list for both.Additional selling point: the exclude file can be managed in git without tampering with CI scripts.
Example usage
Now
With proposed feature
aws s3 sync . s3://bucket/html/ --exclude-file .syncignoreAlternatives I have considered
None really. The only alternative I know of is using many single statements.