In this video I explain how to connect Jenkins and GitLab.
VIDEO
Tutorial# Go to GitLab website and copy the URL. In my case it is 10.10.0.119
Login via SSH to Jenkins server and copy the certificate from GitLab
1
</dev/null openssl s_client -connect 10.10.0.119:443 -servername 10.10.0.119 | openssl x509 > $HOME /10.10.0.119.crt
copy
1
sudo find / -iname "cacerts"
copy
1
sudo find / -iname "keytool"
copy
Import GitLab certificate to Java cacerts 1
2
3
4
5
6
7
8
# Import GitLab certificate
sudo /usr/lib64/jvm/java-11-openjdk-11/bin/keytool -import -file /home/adrian/10.10.0.119.crt -alias gitlab -keystore /usr/lib64/jvm/java-11-openjdk-11/lib/security/cacerts
# Delete GitLab certificate
sudo /usr/lib64/jvm/java-11-openjdk-11/bin/keytool -delete -alias gitlab -keystore /usr/lib64/jvm/java-11-openjdk-11/lib/security/cacerts
# List all certificates
sudo /usr/lib64/jvm/java-11-openjdk-11/bin/keytool -list -keystore /usr/lib64/jvm/java-11-openjdk-11/lib/security/cacerts
copy
type password Trust this certificate? Type: yes
copy And hit Enter
Restart Jenkins 1
sudo systemctl restart jenkins.service
copy
Install GitLab plugin in Jenkins and restart Jenkins
Log into the GitLab, create a project and generate a token for project.
Go to Manage Jenkins -> System and scroll down to find GitLab section.
Provide a connection name eg. GitLab, GitLab URL and credentials (use API token generated in GitLab for the project to add credentials - see the video)
Test the connection.
Comments