github.com/ssube/gitlab-ci-multi-runner@v1.2.1-0.20160607142738-b8d1285632e6/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  ---
     9  
    10  <!-- START doctoc generated TOC please keep comment here to allow auto update -->
    11  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
    12  **Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*
    13  
    14  - [Overview](#overview)
    15  - [Running as unprivileged user](#running-as-unprivileged-user)
    16  - [Security](#security)
    17  
    18  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
    19  
    20  ## Overview
    21  
    22  The scripts can be run as unprivileged user if the `--user` is added to the
    23  [`gitlab-runner run` command][run]. This feature is only supported by Bash.
    24  
    25  The source project is checked out to:
    26  `<working-directory>/builds/<short-token>/<concurrent-id>/<namespace>/<project-name>`.
    27  
    28  The caches for project are stored in
    29  `<working-directory>/cache/<namespace>/<project-name>`.
    30  
    31  Where:
    32  
    33  - `<working-directory>` is the value of `--working-directory` as passed to the
    34    `gitlab-runner run` command or the current directory where the Runner is
    35    running
    36  - `<short-token>` is a shortened version of the Runner's token (first 8 letters)
    37  - `<concurrent-id>` is a unique number, identifying the local job ID on the
    38    particular Runner in context of the project
    39  - `<namespace>` is the namespace where the project is stored on GitLab
    40  - `<project-name>` is the name of the project as it is stored on GitLab
    41  
    42  To overwrite the `<working-directory>/builds` and `<working-directory/cache`
    43  specify the `builds_dir` and `cache_dir` options under the `[[runners]]` section
    44  in [`config.toml`](../configuration/advanced-configuration.md).
    45  
    46  ## Running as unprivileged user
    47  
    48  If GitLab Runner is installed on Linux from the [official `.deb` or `.rpm`
    49  packages][packages], the installer will try to use the `gitlab_ci_multi_runner`
    50  user if found. If it is not found, it will create a `gitlab-runner` user and use
    51  this instead.
    52  
    53  All shell builds will be then executed as either the `gitlab-runner` or
    54  `gitlab_ci_multi_runner` user.
    55  
    56  In some testing scenarios, your builds may need to access some privileged
    57  resources, like Docker Engine or VirtualBox. In that case you need to add the
    58  `gitlab-runner` user to the respective group:
    59  
    60  ```bash
    61  usermod -aG docker gitlab-runner
    62  usermod -aG vboxusers gitlab-runner
    63  ```
    64  
    65  ## Security
    66  
    67  Generally it's unsafe to run tests with shell executors. The jobs are run with
    68  the user's permissions (`gitlab-runner`) and can "steal" code from other
    69  projects that are run on this server. Use it only for running builds on a
    70  server you trust and own.
    71  
    72  [run]: ../commands/README.md#gitlab-runner-run
    73  [packages]: https://packages.gitlab.com/runner/gitlab-ci-multi-runner