diff options
Diffstat (limited to 'doc/ci/git_submodules.md')
-rw-r--r-- | doc/ci/git_submodules.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/ci/git_submodules.md b/doc/ci/git_submodules.md index ee9d15894fe..68cbff21fae 100644 --- a/doc/ci/git_submodules.md +++ b/doc/ci/git_submodules.md @@ -60,6 +60,13 @@ To make submodules work correctly in CI/CD jobs: GIT_SUBMODULE_STRATEGY: recursive ``` +1. Use `GIT_SUBMODULE_DEPTH` to configure the cloning depth of submodules independently of the [`GIT_DEPTH`](runners/configure_runners.md#shallow-cloning) variable: + + ```yaml + variables: + GIT_SUBMODULE_DEPTH: 1 + ``` + 1. You can filter or exclude specific submodules to control which submodules will be synced using [`GIT_SUBMODULE_PATHS`](runners/configure_runners.md#git-submodule-paths). @@ -76,6 +83,14 @@ To make submodules work correctly in CI/CD jobs: GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_UPDATE_FLAGS: --jobs 4 ``` + +1. You can set the [GIT_SUBMODULE_PATHS](runners/configure_runners.md#sync-or-exclude-specific-submodules-from-ci-jobs) to explicitly ignore submodules during cloning: + + ```yaml + variables: + GIT_SUBMODULE_STRATEGY: recursive + GIT_SUBMODULE_PATHS: ':(exclude)submodule' + ``` If you use the [`CI_JOB_TOKEN`](jobs/ci_job_token.md) to clone a submodule in a pipeline job, the user executing the job must be assigned to a role that has |