gitlab
For now these are the steps of the last installation (dec 2021) on servert1
installation
Probably: you should download gitlab-ee debian package, but i already had it in aptitude so follow these steps.
| install | |
|---|---|
Note that this will use port 80 and will interfere with apache, so you might have to do http://192.168.1.204:4444/ or something, i did it wrong so i reconfigured...
Reconfigure it in /etc/gitlab/gitlab.rb
| /etc/gitlab/gitlab.rb | |
|---|---|
And run :
Now give it some time, it will say for minutes 'too long to respond'. Finally you will get a login on the given url. Note that it's credentials are in .. code-block:
/etc/gitlab/initial_root_password
First thing to do is add a normal user. Admin -> Users -> New User Be sure to make it 'Admin' so you won't need root anymore.
gitlab-runner
Install this on a different system if possible, but local works.
Finally you have to register the runner but you need the token from the gitlab server for that , so fill the REGISTRATION_TOKEN with that or just paste it in place.
| register with server | |
|---|---|
You will have to choose what executor to use here. Shell is the easiest one because of course you can run docker from the shell as well. But if docker is really the only tool used, docker might be a better executor.
Also shell gives this error :
| error | |
|---|---|
See : https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading
create ci/cd pipeline
First make sure you can see the runner just added in gitlab, not you don't get settings unless you are admin !
Settings -> CI/CD -> Expand the Runners.
Now you see "Available specific runners". Click the edit pencil : Especially to prevent errors with "This job is stuck" make sure the "Run untagged jobs" is enabled.
debug problems
Both the problem with the shell runner and the problem with "/bin/bash: line 114: docker: command not found" can be investigated by logging into the runner-server and becoming user gitlab-runner.
For instance this can be used to reproduce a docker socket error:
| debugging | |
|---|---|
And it does output the sane as in the gitlab-runner console:
| error | |
|---|---|
This, by the way, is how to solve that problem :)
| fix socket problem | |
|---|---|
Note that this is a good way to tryout all your runner steps before running it on gitlab. Also note that the gitlab-runner finished way faster because it was already compiled on the runner machine itself.
However one specific error is : ERROR: Job failed (system failure): prepare environment: exit status 1. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
TLDR: it says empty .bash_logout content (the clear makes it fail)
stop gitlab and runners
| stop | |
|---|---|
Monitor if this time gives a change in downtimes on both servert and hoek !!
I needed this to test if gitlab was causing network downtime on both caiway and xs4all interfaces.
This should tone down the noise on the servert1 machine as well.