doc/nextlevel-ci: added snippet to install a GitLab runner
To use the GitLab CI on a project, a server needs to install a runner. The NetModule Know-How documentation holds already an instruction guide about how to set up such a runner. For completness a short summary is added to the next-level CI page. Signed-off-by: Marc Mattmüller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
5e4f2fd812
commit
69cacceb4d
|
|
@ -511,6 +511,62 @@ much the already heavily loaded HAC CI team.
|
|||
So the further documentation is done in :ref:`nwlCiCd`
|
||||
|
||||
|
||||
GitLab CI/CD - Keep in mind
|
||||
###########################
|
||||
The documentation to install a GitLab CI Running is located in the
|
||||
`know-how documentation <https://jenkins.netmodule.intranet/job/NMOS/job/generate-doc/job/develop/Know-How_20Doc/infrastructure/jenkins-buildslave.html#install-gitlab-runner>`_
|
||||
|
||||
As a short summary see the instructions below (more details on
|
||||
`GitLab <https://docs.gitlab.com/runner/install/linux-repository.html>`_):
|
||||
|
||||
1. Make sure you have installed the docker engine on your build server:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# setup the repo:
|
||||
server:~$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
||||
# select the stable repo:
|
||||
server:~$ echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
|
||||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
# install the engine:
|
||||
server:~$ sudo apt update
|
||||
server:~$ sudo apt install docker-ce docker-ce-cli containerd.io
|
||||
|
||||
2. Install the runner on the build server:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# setup the repo:
|
||||
server:~$ curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash
|
||||
|
||||
# install the runner package:
|
||||
server:~$ sudo apt-get install gitlab-runner
|
||||
|
||||
3. Get the registration token from the GitLab CI/CD Settings page:
|
||||
|
||||
* Go to `Settings >> CI/CD`, expand runners and **read the token**
|
||||
|
||||
4. Register now the runner by replacing TOKEN with the read token of the previous step:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Register the runner on the server:
|
||||
sudo gitlab-runner register \
|
||||
-non-interactive \
|
||||
--registration-token TOKEN \
|
||||
--url https://gitlab.netmodule.intranet/ \
|
||||
--tls-ca-file /etc/ssl/certs/NetModule_AG_Root_CA.crt \
|
||||
--description "OEM-Linux1" \
|
||||
--executor "docker" \
|
||||
--docker-image docker:20
|
||||
|
||||
5. Launch your pipeline of a project
|
||||
|
||||
|
||||
|
||||
Sandbox Section ;-D
|
||||
###################
|
||||
some links:
|
||||
|
|
|
|||
Loading…
Reference in New Issue