How to Create Your Own Gitlab Runner!

If you decide to make your own gitlab runner for whatever reason, the process isn’t complicated at all!

source : https://stackoverflow.com/questions/57440984/do-i-need-gitlab-runner-to-perform-cicd-for-my-projects-in-gitlab

This article was written as a submission of CS UI’s software development course’s article task.

Installing gitlab-runner

To install gitlab-runner on your machine, you simply have to download the appropriate package.

  1. Choose a version and download a binary, as described in the documentation for downloading any other tagged releases for bleeding edge GitLab Runner releases.
#For debian or ubuntu
curl -LJO "https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_${arch}.deb"
#For CentOS or Red Hat Enterprise Linux
curl -LJO "https://gitlab-runner-downloads.s3.amazonaws.com/latest/rpm/gitlab-runner_${arch}.rpm"
#For debian or ubuntu
dpkg -i gitlab-runner_<arch>.deb
#For CentOS or Red Hat Enterprise Linux
rpm -i gitlab-runner_<arch>.deb

Registering your Runner

Once you’ve installed gitlab-runner on your system, you now have to register it as a runner. To do so, follow these steps:

Advantages

Because you have your own machine is now a gitlab-runner, you can configure it. On Ubuntu, the configuration file should be located at /etc/gitlab-runner/config.toml.

Our “prune_log”, which keeps track of what the “docker prune” script deletes and when.

Conclusion

And that’s it! That’s all there is to it. Although it might seem intimidating and complicated at first, gitlab has really made it easy to set up your own runner, and we should commend them for that! It gives us more freedom in how we deploy our apps. Although it comes with a few caveats (namely maintenance), with a little know-how and effort, you can overcome them all because you have full of your machine.

Sources:

If you're reading an article from me, It's probably a part of my college course.