0

I have installed gitlab-runner on a new OSX device. My runner is register and launch correctly.

But when i start a job, I have this error

sudo gem install fastlane
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required

What can I do avoid this error and let gitlab-runner have sudo access to execute anything ?

Kevin ABRIOUX
  • 16,507
  • 12
  • 93
  • 99

1 Answers1

0

Most probably you granted the sudo permission to your gitlab-runner user, but you did not remove the password restriction for sudo for the gitlab-runner user. Here you can find how to do it.

However I would not recommend using sudo. You could use Bundler and then install fastlane with bundler for this project and not globally.

  1. gem install bundler -> you will get a Gemfile for the current directory (root of the project)

  2. put gem "fastlane" into the Gemfile

  3. install it with bundle install (you can run this command with your gitlab-runner user in jobs)

For running fastlane lanes use: bundle exec fastlane <name_of_the_lane>.

  • Nemanja Fillipovic, the thing is the like for the answer which you have provided, it just shows how to use it using usermod, and usermod is not supported on macOS. But the question is being asked for macOS – Weirdoooo Dec 06 '22 at 06:00
  • @Weirdoooo as I said, I would not use sudo at all. I would use the Bundler so you do not need sudo. – Nemanja Filipovic Dec 20 '22 at 18:29