-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add MR_USER_BASE environment variable to override system-wide d…
…efault for runners' local users base directory
- Loading branch information
Showing
2 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3394733
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! FYI, alternative approach I've been doing recently is using bash arrays to conditionally add more args...
if [ -n "$MR_USER_BASE" ]
then
SET_HOME_ARGS=(-b "$MR_USER_BASE")
else
SET_HOME_ARGS=()
fi
useradd "$SET_HOME_ARGS[@]" ...
Then you don't have to parse the useradd defaults file and can just conditionally add in arguments.
3394733
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! I've added this approach in 95b39d0.