@@ -662,11 +662,15 @@ Files and Directories
662
662
path
663
663
(required) Destination path
664
664
665
+ .. _ignore-regex :
666
+
665
667
ignore-regex
666
668
(default ``(^|/)\.(git|hg|svn|vagga)($|/)|~$|\.bak$|\.orig$|^#.*#$ ``)
667
669
Regular expression of paths to ignore. Default regexp ignores common
668
670
revision control folders and editor backup files.
669
671
672
+ .. _include-regex :
673
+
670
674
include-regex
671
675
(default ``None ``)
672
676
Regular expression of paths to include. When path matches both ignore and
@@ -682,6 +686,57 @@ Files and Directories
682
686
unmapped users (the ones that don't belong to user's subuid/subgid range),
683
687
will be set to ``nobody `` (65535).
684
688
689
+ .. _rules :
690
+
691
+ rules
692
+ Leverages glob patterns instead of regular expressions to match paths.
693
+ This option conflicts with ``ignore-regex `` and ``include-regex `` options.
694
+
695
+ The rules are similar to those which is used in
696
+ `.gitignore <https://git-scm.com/docs/gitignore >`_ file but meaning of
697
+ include/exclude rules is opposite. Also there are several differences:
698
+
699
+ * Include patterns **must ** be absolute so they have to start with
700
+ a leading slash. This is done for performance reasons to exclude
701
+ unknown directories from traversing. If you really want to match relative
702
+ paths you can prepend pattern with a slash followed by two consecutive
703
+ asterisks. Thus ``/**/*.py `` pattern will match ``test.py ``,
704
+ ``dir/main.py ``, ``dir/subdir/test.py `` paths and so on.
705
+ * ``! `` prefix negates the pattern. Negative patterns can be relative.
706
+ Unlike `.gitignore ` patterns it is possible to include a file when its
707
+ parent directory was excluded. For instance rules
708
+ ``["!dir", "/dir/*.py"] `` will match all python files inside the ``dir ``
709
+ directory.
710
+ * If there is no matched files inside a directory the directory itself
711
+ won't be copied.
712
+ * If the pattern ends with a slash, it will match only with a direcotory
713
+ and paths underneath it. Also ``/dir/ `` pattern will copy ``dir ``
714
+ directory even if it is empty.
715
+ * Empty rules will match all underneath paths. But if you add only exclude
716
+ rules no path will be matched. So you should explicitly add at least one
717
+ include rule:
718
+
719
+ ``[] `` will match all paths
720
+
721
+ ``["!dir/"] `` will match nothing
722
+
723
+ ``["!dir/", "/"] `` will match all paths except ``dir `` directories
724
+
725
+ By default there are some ignore rules that correspond ``ignore-regex ``
726
+ expression:
727
+ ``["!.git/", "!.hg/", "!.svn/", "!.vagga/", "!*.bak", "!*.orig", "!*~",
728
+ "!#*#", "!.#*"] ``
729
+
730
+ .. versionadded :: 0.7.3
731
+
732
+ .. _no-default-rules :
733
+
734
+ no-default-rules
735
+ Disables default ignore rules which are given above. The option only works
736
+ in pair with ``rules `` option.
737
+
738
+ .. versionadded :: 0.7.3
739
+
685
740
.. warning :: If the source directory starts with `/work` all the files are
686
741
read and checksummed on each run of the application in the container. So
687
742
copying large directories for this case may influence container startup
@@ -782,6 +837,25 @@ Meta Data
782
837
if it's temporary container that depends on some generated file (sometimes
783
838
useful for tests).
784
839
840
+ Options:
841
+
842
+ path
843
+ (required) Relative path to directory or file inside ``/work `` directory.
844
+ Matched files and directories will be checksummed to get the version of
845
+ the container.
846
+
847
+ ignore-regex
848
+ See `ignore-regex `_
849
+
850
+ include-regex
851
+ See `include-regex `_
852
+
853
+ rules
854
+ See `rules `_
855
+
856
+ no-default-rules
857
+ See `no-default-rules `_
858
+
785
859
786
860
Sub-Containers
787
861
==============
0 commit comments