Skip to content

Support separate users in different build stages*

Sune Keller requested to merge (removed):runner-user into master

What does this MR do?

*Build stages refer to the common.BuildStage stages.

As part of this commit, the shell configuration is re-computed on every ExecutorCommand being run, in order to pick up any changes in the shell command and arguments -- specifically the user in any "su" commands.

Additionally, the pre_build_script and post_build_script scripts are introduced as proper build stages to support them running as other users than the user pipeline's scripts from .gitlab-ci.yml.

Why was this MR needed?

The details are described in #3945, but basically to support this choice of shell script users in the respective phases:

Build stage/User Runner service/container user (e.g. root) Runner-configured user (e.g. gitlab-runner)
Pre (pre_clone_script, pre_build_script) X
User (before_script, jobs, after_script) X
Post (post_build_script) X

Are there points in the code the reviewer needs to double check?

Whether there is another way to update the shell's command and arguments at an appropriate place.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug (note: only accommodated tests to not fail with the new added stages)
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

Edited by Sune Keller

Merge request reports

Loading