How to run sudo in gitlab-ci shell executor

Grant sudo to gitlab-runner user

$ sudo usermod -a -G sudo gitlab-runner

Edit visudo permission

$ sudo visudo

Append the following line at the bottom of the file

gitlab-runner ALL=(ALL) NOPASSWD: ALL

Leave a Reply

Your email address will not be published. Required fields are marked *