summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2018-06-18 12:39:42 +0000
committerAchilleas Pipinellis <axil@gitlab.com>2018-06-18 12:39:42 +0000
commitaeb3df17272cd1afec8297a0c7399c44aa8477d5 (patch)
tree3a53759b40759e406d6b2c8abfa6b635b2b039b5
parentfa4f71e4a90d7d1f40e1c9f60cde343a668c7bda (diff)
parent864bfcd2637ed185f765495addf6c85501c9c8a2 (diff)
downloadgitlab-ce-aeb3df17272cd1afec8297a0c7399c44aa8477d5.tar.gz
Merge branch '2211-add-option-to-change-clone-path-docs' into 'master'
Document Custom build directories Closes gitlab-runner#2211 See merge request gitlab-org/gitlab-ce!19664
-rw-r--r--doc/ci/yaml/README.md38
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index 8e13ceb9257..e11eb840265 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -1406,6 +1406,43 @@ variables:
You can set it globally or per-job in the [`variables`](#variables) section.
+### Custom build directories
+
+> [Introduced][gitlab-runner-876] in Gitlab Runner 11.1
+
+NOTE: **Note:**
+This can only be used when `custom_build_dir` is set to true in the [Runner's
+configuration](https://docs.gitlab.com/runner/configuration/advanced-configuration.html).
+
+By default, GitLab Runner clones the repository in the `/builds` directory,
+but sometimes your project might require to have the code in a specific
+directory, like the GO projects for example. In that case, you can specify
+the `CI_PROJECT_DIR` variable to tell the Runner in which directory to clone
+the repository:
+
+```yml
+image: golang:1.10-alpine3.7
+
+variables:
+ CI_PROJECT_DIR: /go/src/gitlab.com/namespace/project-name
+
+stages:
+ - test
+
+dir:
+ stage: test
+ script:
+ - pwd # /go/src/gitlab.com/namespace/project-name
+```
+
+The following executors may use this feature only when
+[concurrent](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-global-section)
+is set to `1`:
+
+- `shell`
+- `ssh`
+- `docker`, `docker+machine` when the job's working directory is mounted as a host volume.
+
## Special YAML features
It's possible to use special YAML features like anchors (`&`), aliases (`*`)
@@ -1599,5 +1636,6 @@ CI with various languages.
[ce-7983]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7983
[ce-7447]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7447
[ce-12909]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12909
+[gitlab-runner-876]: https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/876
[schedules]: ../../user/project/pipelines/schedules.md
[variables-expressions]: ../variables/README.md#variables-expressions