Skip to content

Instantly share code, notes, and snippets.

@salipro4ever
Last active July 6, 2023 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save salipro4ever/368b10fa4584017233017ef461ebc809 to your computer and use it in GitHub Desktop.
Save salipro4ever/368b10fa4584017233017ef461ebc809 to your computer and use it in GitHub Desktop.
sudo: gitlab-runner: command not found

REF https://docs.gitlab.com/runner/install/


For RHEL/CentOS/Fedora (Recommend)

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash
yum list gitlab-runner --showduplicates | sort -r // show all version.
yum install gitlab-runner
yum install gitlab-runner-{13.0.2-1}

OR

curl -LJO https://gitlab-runner-downloads.s3.amazonaws.com/latest/rpm/gitlab-runner_{abc}.rpm
curl -LJO https://gitlab-runner-downloads.s3.amazonaws.com/v13.0.0/rpm/gitlab-runner_amd64.rpm. // for version

rpm -i gitlab-runner_{abc}.rpm

ln -s /usr/local/bin/gitlab-runner /usr/bin/gitlab-runner

If manually build, you need add /usr/local/bin to secure_path


Register

https://docs.gitlab.com/runner/register/index.html#linux
https://docs.gitlab.com/runner/commands/

sudo gitlab-runner register

cat /etc/sudoers

#Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
## Next comes the main part: which users can run what software on 
## which machines (the sudoers file can be shared between multiple
## systems).

echo "gitlab-runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment