Custom job shell
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Release notes
Gitlab can build on many platforms, but some systems, including docker images require complex bootstrapping before a build can be started.
By default, gitlab executes builds in /bin/sh
on unix/linux and powershell for windows. This feature would let developers specify the shell to be used for the scripts in a job directly in the gitlab YAML.
Intended users
Any developer:
- Delaney (Development Team Lead)
- Sasha (Software Developer)
- Devon (DevOps Engineer)
- Sidney (Systems Administrator)
- Sam (Security Analyst)
- Rachel (Release Manager)
- Alex (Security Operations Engineer)
- Simone (Software Engineer in Test)
- Allison (Application Ops)
- Priyanka (Platform Engineer)
- Dana (Data Analyst) -->
User experience goal
A developer should be able to specify any shell program and have the job scripts execute within it. The shell can be anything that can accept a single file as an argument (that file contains the script content), eg:
/bin/sh
/usr/local/bin/python
powershell
cmd
perl
Proposal
Example yaml:
job:
image: docker:dind
shell: dockerd-entrypoint.sh /bin/sh
script:
- docker run --rm -v $(pwd):/mounted ....
or even
job:
image: python:3.7
shell: python
script:
- import os
- print("hello world, cwd={}".format(os.getcwd())
Permissions and Security
No extra permissions beyond being able to trigger a pipeline