Hi ,
I’ve found many examples where people configured with docker, if we need simple configuration for internal uses, we have also an alternative that can help to configure your GitLab CI runner easily.
In my usecase, i’m using Centos.
- add gitlab multi runner to yum repository
# curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | sudo bash
2.once added to repository install gitlab-multi runner
#sudo yum install gitlab-ci-multi-runner
once gitlab runner install, it will create “gitlab-runner” user in your machine
may find here “/home/gitlab-runner” , gitlab-runner user do not have permission you need to add it to user group or something else whatever you need.
you can also see multiple commands provided by gitlab runner
#gitlab-runner –help
now ,we need to configure it with our gitlab hosted repository
#sudo gitlab-ci-multi-runner register
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://mygitlab.com/ci
Please enter the gitlab-ci token for this runner
xxx
Please enter the gitlab-ci description for this runner
my-runner
INFO[0034] fcf5c619 Registering runner… succeeded
Please enter the executor: shell, docker, docker-ssh, ssh?
shell
running already the config should be automatically reloaded!
————————————————-
after gitlab runner successfully configure you will see “admin area ->Runner” in gitlab
something similar to below images
that is not completed yet you also need to configure Ci with include this file in your project root directory “”
added some configuration related to your project build and unit test running etc..
here is simple example i’ve added in “.gitlab-ci.yml” file
web_server_build:
script:
– cd spirng-mvc
– echo “making build”
– ./gradlew clean
– ./gradlew build
once configuration done, every commit we can run our build
may I have skip few steps, let us know if require, I will update that.
Thanks for reading 🙂
Follow @nikeshpathak