github.com/nilium/gitlab-runner@v12.5.0+incompatible/docs/executors/shell.md (about)

     1  # Shell
     2  
     3  The Shell executor is a simple executor that allows you to execute builds
     4  locally to the machine that the Runner is installed. It supports all systems on
     5  which the Runner can be installed. That means that it's possible to use scripts
     6  generated for Bash, Windows PowerShell and Windows Batch.
     7  
     8  NOTE: **Note:**
     9  GitLab Runner will use the `git lfs` command if [Git LFS](https://git-lfs.github.com) is installed on the machine.
    10  Ensure Git LFS is up-to-date on any systems where GitLab Runner will run using shell executor.
    11  
    12  ## Overview
    13  
    14  The scripts can be run as unprivileged user if the `--user` is added to the
    15  [`gitlab-runner run` command][run]. This feature is only supported by Bash.
    16  
    17  The source project is checked out to:
    18  `<working-directory>/builds/<short-token>/<concurrent-id>/<namespace>/<project-name>`.
    19  
    20  The caches for project are stored in
    21  `<working-directory>/cache/<namespace>/<project-name>`.
    22  
    23  Where:
    24  
    25  - `<working-directory>` is the value of `--working-directory` as passed to the
    26    `gitlab-runner run` command or the current directory where the Runner is
    27    running
    28  - `<short-token>` is a shortened version of the Runner's token (first 8 letters)
    29  - `<concurrent-id>` is a unique number, identifying the local job ID on the
    30    particular Runner in context of the project
    31  - `<namespace>` is the namespace where the project is stored on GitLab
    32  - `<project-name>` is the name of the project as it is stored on GitLab
    33  
    34  To overwrite the `<working-directory>/builds` and `<working-directory/cache`
    35  specify the `builds_dir` and `cache_dir` options under the `[[runners]]` section
    36  in [`config.toml`](../configuration/advanced-configuration.md).
    37  
    38  ## Running as unprivileged user
    39  
    40  If GitLab Runner is installed on Linux from the [official `.deb` or `.rpm`
    41  packages][packages], the installer will try to use the `gitlab_ci_multi_runner`
    42  user if found. If it is not found, it will create a `gitlab-runner` user and use
    43  this instead.
    44  
    45  All shell builds will be then executed as either the `gitlab-runner` or
    46  `gitlab_ci_multi_runner` user.
    47  
    48  In some testing scenarios, your builds may need to access some privileged
    49  resources, like Docker Engine or VirtualBox. In that case you need to add the
    50  `gitlab-runner` user to the respective group:
    51  
    52  ```bash
    53  usermod -aG docker gitlab-runner
    54  usermod -aG vboxusers gitlab-runner
    55  ```
    56  
    57  ## Selecting your shell
    58  
    59  GitLab Runner [supports certain shells](../shells/index.md). To select a shell, specify it in your `config.toml` file. For example:
    60  
    61  ```toml
    62  ...
    63  [[runners]]
    64    name = "shell executor runner"
    65    executor = "shell"
    66    shell = "powershell"
    67  ...
    68  ```
    69  
    70  ## Security
    71  
    72  Generally it's unsafe to run tests with shell executors. The jobs are run with
    73  the user's permissions (`gitlab-runner`) and can "steal" code from other
    74  projects that are run on this server. Use it only for running builds on a
    75  server you trust and own.
    76  
    77  [run]: ../commands/README.md#gitlab-runner-run
    78  [packages]: https://packages.gitlab.com/runner/gitlab-runner