diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-08 00:10:26 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-08 00:10:26 +0000 |
commit | 9695fcf51937fbba91c8bf9ea076ba376fe2a4b1 (patch) | |
tree | 55b2c576e10348a2317da6cdf4e38af1dc16fb64 /doc/ci/runners/configure_runners.md | |
parent | 364e69bafd235e5689fba44bb5eef37305cb6c6d (diff) | |
download | gitlab-ce-9695fcf51937fbba91c8bf9ea076ba376fe2a4b1.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/ci/runners/configure_runners.md')
-rw-r--r-- | doc/ci/runners/configure_runners.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/ci/runners/configure_runners.md b/doc/ci/runners/configure_runners.md index 6ace58d5b11..54fc83fb864 100644 --- a/doc/ci/runners/configure_runners.md +++ b/doc/ci/runners/configure_runners.md @@ -306,6 +306,7 @@ globally or for individual jobs: - [`GIT_STRATEGY`](#git-strategy) - [`GIT_SUBMODULE_STRATEGY`](#git-submodule-strategy) +- [`GIT_SUBMODULE_PATHS`](#sync-or-exclude-specific-submodules-from-ci-jobs) - [`GIT_CHECKOUT`](#git-checkout) - [`GIT_CLEAN_FLAGS`](#git-clean-flags) - [`GIT_FETCH_EXTRA_FLAGS`](#git-fetch-extra-flags) @@ -564,6 +565,34 @@ You should be aware of the implications for the security, stability, and reprodu your builds when using the `--remote` flag. In most cases, it is better to explicitly track submodule commits as designed, and update them using an auto-remediation/dependency bot. +### Sync or exclude specific submodules from CI jobs + +> [Introduced](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/26495) in GitLab Runner 14.0. + +Some projects have a large number of submodules, and not all of them need to be +synced or updated in all CI jobs. Use the `GIT_SUBMODULE_PATHS` variable to control this behavior. +The path syntax is the same as [`git submodule`](https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-ltpathgt82308203): + +- To sync and update specific paths: + + ```yaml + variables: + GIT_SUBMODULE_PATHS: 'submoduleA' + ``` + +- To exclude specific paths: + + ```yaml + variables: + GIT_SUBMODULE_PATHS: ':(exclude)submoduleA' + ``` + +WARNING: +Git ignores nested and multiple submodule paths. To ignore a nested submodule, exclude +the parent submodule and then manually clone it in the job's scripts. For example, + `git clone <repo> --recurse-submodules=':(exclude)nested-submodule'`. Make sure +to wrap the string in single quotes so the YAML can be parsed successfully. + ### Shallow cloning > Introduced in GitLab 8.9 as an experimental feature. |