1
0

ci.md 2.7 KB

Continuous Integration

Tools and tips.

Laminar Ci

Laminar official website

Configure Laminar

Laminar installation automatically create a laminar user.

To edit files in Laminar config folder (default /var/lib/laminar/cfg/jobs) without sudo, you can use the GNU/Linux group mechanism :

sudo usermod -a -G laminar jovian
chmod -R sudo chmod -R g+w /var/lib/laminar/cfg/

Jenkins

How to install and administrate Jenkins. This tool is using Java, requiring a lot of memory and CPU resources. It is not recommanded to use it on Rasperry Pi, the UI is slow and unresponsive.

Install

Java

You need Java 8 or 11 if you have Jenkins above 2.164.

sudo apt install openjdk-8-jre

Raspberry Pi

Jenkins doc : installation

To execute on debian server

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add - ;
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' ;
sudo apt-get update ;
sudo apt-get install jenkins ;

Jenkins is now installed as a daemon and you should connect locally to it with a browser to complete installation.

192.168.0.40:8080

HTTPS

The best way to secure Jenkins is to use the proxy with Apache.

Jenkins wiki : running Jenkins behind Apache

See the JovianHttpd repository to see the template for configuration.

Integration

Integrate Jenkins with other tools

Gogs

Plugin

Install gogs-webhook plugin.

Documentation on plugins.jenkins.io.

Add webhook on Gogs side

In the Gogs repository settings, add the webhook

https://jenkins.jovian-hersemeule.eu/gogs-webhook/?job=experiments/connect

Adapt job name.

Private communication
  • Create a Jenkins account on Gogs
  • Generate an SSH key with ssh-keygen
  • Create credentials under Jenkins and store private key and passphrase
  • Put SSH public key in Jenkins account on Gogs
  • On Gogs : Add Jenkins user with read rights to any repository Jenkins has to build

Apache2 http server

How to deploy on a Httpd server.

Grant jenkins user

You have to set jenkins user owner of the targeted folder.

Trouble shooting

Logs

In file /var/log/jenkins/jenkins.log

Git describe

To allow the command git describe to work, go to your job configuration and add an Advanced Cloned Behaviours and tick the tags checkbox.

Configure

Configuration parameters can be found at /etc/default/jenkins

Useful plugins

Basic Branch strategy

Useful to build tags.