Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SUDOER variable to allow passwordless sudo access in shell executor #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ configure_ci_runner() {
fi
}

configure_sudoer() {
if [[ $SUDOER == true ]]; then
sudo adduser ${GITLAB_CI_MULTI_RUNNER_USER} sudo
sudo echo "${GITLAB_CI_MULTI_RUNNER_USER} ALL=NOPASSWD: ALL" > /etc/sudoers.d/${GITLAB_CI_MULTI_RUNNER_USER}
fi
}

# allow arguments to be passed to gitlab-ci-multi-runner
if [[ ${1:0:1} = '-' ]]; then
EXTRA_ARGS="$@"
Expand All @@ -75,6 +82,7 @@ if [[ -z ${1} ]]; then
update_ca_certificates
generate_ssh_deploy_keys
grant_access_to_docker_socket
configure_sudoer
configure_ci_runner

start-stop-daemon --start \
Expand Down