github.com/nilium/gitlab-runner@v12.5.0+incompatible/docs/best_practice/index.md (about) 1 # Best practice 2 3 Below are some guidelines you should follow when you use and administer 4 GitLab Runner. 5 6 ## Build Directory 7 8 GitLab Runner will clone the repository to a path that exists under a 9 base path better known as the _Builds Directory_. The default location 10 of this base directory depends on the executor. For: 11 12 - [Kubernetes](../executors/kubernetes.md), 13 [Docker](../executors/docker.md) and [Docker 14 Machine](../executors/docker_machine.md) executors it will be 15 `/builds` inside of the container. 16 - [Shell](../executors/shell.md) executor it will be `$PWD/builds`. 17 - [SSH](../executors/ssh.md), [VirtualBox](../executors/virtualbox.md) 18 and [Parallels](../executors/parallels.md) executors it will be 19 `~/builds` in the home directory of the user configured to handle the 20 SSH connection to the target machine. 21 - [Custom](../executors/custom.md) executor no default is provided and 22 it must be explicitly configured, otherwise, the job will fail. 23 24 The used _Builds Directory_ may be defined explicitly by the user with the 25 [`builds_dir`](../configuration/advanced-configuration.md#the-runners-section) 26 setting. 27 28 TIP: **Tip:** 29 You can also specify 30 [`GIT_CLONE_PATH`](https://docs.gitlab.com/ee/ci/yaml/README.html#custom-build-directories) 31 if you want to clone to a custom directory, and the guideline below 32 doesn't apply. 33 34 GitLab Runner will use the _Builds Directory_ for all the Jobs that it 35 will run, but nesting them using a specific pattern 36 `{builds_dir}/$RUNNER_TOKEN_KEY/$CONCURRENT_ID/$NAMESPACE/$PROJECT_NAME`. 37 For example: `/builds/2mn-ncv-/0/user/playground`. 38 39 GitLab Runner does not stop you from storing things inside of the 40 _Builds Directory_. For example, you can store tools inside of 41 `/builds/tools` that can be used during CI execution. We **HIGHLY** 42 discourage this, you should never store anything inside of the _Builds 43 Directory_. GitLab Runner should have total control over it and does not 44 provide stability in such cases. If you have dependencies that are 45 required for your CI, we recommend to have them installed in some other 46 place.