diff --git a/content/doc/book/pipeline/shared-libraries.adoc b/content/doc/book/pipeline/shared-libraries.adoc index bea45807a881..fa8e84387ea5 100644 --- a/content/doc/book/pipeline/shared-libraries.adoc +++ b/content/doc/book/pipeline/shared-libraries.adoc @@ -319,6 +319,47 @@ It is best to refer to *Pipeline Syntax* for the precise syntax for your SCM. Note that the library version _must_ be specified in these cases. +=== Caching for Quick Retrievals + +The plugin allows caching to be enabled for quick retrievals. One can configure `"Versions to exclude"` and +`"Versions to include"`. The mechanism for both is very similar, however, the use-cases differ as below: + +==== Versions to exclude + +This feature allows `exclusion` of specific versions from caching. It works great when you want to allow multiple +versions to cache, however, exclude one or more of them from caching. + +It allows specifying substrings or complete version names as shown in the example below: + +* Excludes the version `feature/versions_to_exclude` from caching. +* Excludes any versions with the substring `test/` from caching (eg:- test/feature1). + +image::pipeline/versions-to-exclude.png["Versions to Exclude", role=center] + +==== Versions to include + +This feature allows `inclusion` of only specific versions for caching. It is really helpful when you have many versions +and require caching to be enabled only on selective versions. If nothing is specified in this block, +it would by default enable caching. + +It allows specifying substrings or complete version names as shown in the example below: + +* Includes the version `feature/versions_to_include` to enable caching. +* Includes any versions with the substring `test/` to enable caching (eg:- test/feature1). + +image::pipeline/versions-to-include.png["Versions to Include", role=center] + + +[NOTE] +==== +`Versions to exclude` will always take precedence over `Versions to include`. +In the example below, even though the same version is mentioned in both the blocks, it would be +excluded from caching. +==== + +image::pipeline/versions-mention-conflict.png["Versions to Specify Conflict", role=center] + + == Writing libraries At the base level, any valid diff --git a/content/doc/book/resources/pipeline/versions-mention-conflict.png b/content/doc/book/resources/pipeline/versions-mention-conflict.png new file mode 100644 index 000000000000..8b7d15e610e6 Binary files /dev/null and b/content/doc/book/resources/pipeline/versions-mention-conflict.png differ diff --git a/content/doc/book/resources/pipeline/versions-to-exclude.png b/content/doc/book/resources/pipeline/versions-to-exclude.png new file mode 100644 index 000000000000..005df0367dc6 Binary files /dev/null and b/content/doc/book/resources/pipeline/versions-to-exclude.png differ diff --git a/content/doc/book/resources/pipeline/versions-to-include.png b/content/doc/book/resources/pipeline/versions-to-include.png new file mode 100644 index 000000000000..09324f39cb77 Binary files /dev/null and b/content/doc/book/resources/pipeline/versions-to-include.png differ