summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJohan Brandhorst <johan@cognitivelogic.com>2017-03-24 16:39:45 +0000
committerJohan Brandhorst <johan@cognitivelogic.com>2017-03-29 15:34:07 +0100
commitfeb7092e4e338a3a5050a4d5006431409794c4fd (patch)
tree1f594e61d11cbe247c0089e61740ce7127bfc26c /doc
parentec6f091e271806a4b87f227737d3cd151970ccb0 (diff)
downloadgitlab-ce-feb7092e4e338a3a5050a4d5006431409794c4fd.tar.gz
Add tip about general git clone authentication.
The CI_JOB_TOKEN post 8.12 allows the cloning of any repositories that are accessible by the triggering user. This was not documented anywhere, and the documentation was in particular very specific on git submodule dependency management. This commit adds a tip about cloning arbitrary repository paths.
Diffstat (limited to 'doc')
-rw-r--r--doc/user/project/new_ci_build_permissions_model.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/user/project/new_ci_build_permissions_model.md b/doc/user/project/new_ci_build_permissions_model.md
index b559d132590..17087986c6c 100644
--- a/doc/user/project/new_ci_build_permissions_model.md
+++ b/doc/user/project/new_ci_build_permissions_model.md
@@ -141,6 +141,7 @@ with GitLab 8.12.
With the new job permissions model, there is now an easy way to access all
dependent source code in a project. That way, we can:
+1. Access a project's dependent repositories
1. Access a project's [Git submodules][gitsub]
1. Access private container images
1. Access project's and submodule LFS objects
@@ -177,6 +178,22 @@ As a user:
access to. As an Administrator, you can verify that by impersonating the user
and retry the failing job in order to verify that everything is correct.
+### Dependent repositories
+
+The [Job environment variable][jobenv] `CI_JOB_TOKEN` can be used to
+authenticate any clones of dependent repositories. For example:
+
+```
+git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/myuser/mydependentrepo
+```
+
+It can also be used for system-wide authentication
+(only do this in a docker container, it will overwrite ~/.netrc):
+
+```
+echo -e "machine gitlab.com\nlogin gitlab-ci-token\npassword ${CI_JOB_TOKEN}" > ~/.netrc
+```
+
### Git submodules
To properly configure submodules with GitLab CI, read the
@@ -221,3 +238,4 @@ test:
[triggers]: ../../ci/triggers/README.md
[update-docs]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update
[workhorse]: https://gitlab.com/gitlab-org/gitlab-workhorse
+[jobenv]: ../../ci/variables/#predefined-variables-environment-variables