Bash (Bourne Again Shell). All commands executed in Bash context (default for all Unix systems)
sh
Fully Supported
Sh (Bourne shell). All commands executed in Sh context (fallback for
bash
for all Unix systems)
powershell
Fully Supported
PowerShell script. All commands are executed in PowerShell Desktop context. In GitLab Runner 12.0-13.12, this is the default when registering a new runner.
pwsh
Fully Supported
PowerShell script. All commands are executed in PowerShell Core context. In GitLab Runner 14.0 and later, this is the default when registering a new runner.
If a
job fails on the
Prepare environment
stage, it
is likely that something in the shell profile is causing the failure. A common
failure is when there is a
.bash_logout
that tries to clear the console.
To troubleshoot this error, check
/home/gitlab-runner/.bash_logout
. For example, if the
.bash_logout
file has a script section like the following, comment it out and restart the pipeline:
In GitLab 11.11, we announced the
deprecation
of the Windows Batch executor,
cmd
shell, for the GitLab Runner in favor
of
PowerShell
. The
cmd
shell remains included in future versions
of GitLab Runner however, any new feature for Windows is to be tested and supported
only for use with PowerShell. Only critical bugs and regressions to the
cmd
shell
will be investigated and fixed.
You can execute Batch scripts from PowerShell using
Start-Process
"cmd.exe" "/c C:\Path\file.bat"
for old Batch scripts not ported to
PowerShell.
Windows Batch is the default shell used on Windows when
shell
is not
specified.
It doesn’t support executing the build in context of another user.
The generated Batch script is executed by saving its content to file and
passing the filename to the following command:
The example can be copied to your own group or instance for testing. More details
on what other GitLab CI patterns are demonstrated are available at the project page.
If you didn't find what you were looking for,
search the docs
.
If you want help with something specific and could use community support,
post on the GitLab forum
.
For problems setting up or using this feature (depending on your GitLab
subscription).