Jenkins: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Line 15: Line 15:
   Environment="JENKINS_HOME=/home/jenkins"
   Environment="JENKINS_HOME=/home/jenkins"
   ...
   ...
Also if you are using LCOV you will need to implement a permanent change for CSP policy
  System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "default-src 'self'; style-src 'self' 'unsafe-inline';")
Without this the CSS is rendered incorrectly. Again to change this is done in /lib/systemd/system/jenkins.service.
  Environment="JAVA_OPTS=-Djava.awt.headless=true -Dhudson.model.DirectoryBrowserSupport.CSP=\"default-src 'self'; style-src 'self' 'unsafe-inline';\""

Revision as of 00:28, 16 April 2023

Introduction

This page is to provide some tips using the Jenkins Build implementation

Setup

By default the home directory is

 /var/lib/jenkins

You need to move this as /var/lib is not allowed for docker.

To do this you need to change the jenkins.service which resides in /lib/systemd/system/jenkins.service.

 ...
 # Directory where Jenkins stores its configuration and workspaces
 #Environment="JENKINS_HOME=/var/lib/jenkins"
 #WorkingDirectory=/var/lib/jenkins
 
 Environment="JENKINS_HOME=/home/jenkins"
 ...

Also if you are using LCOV you will need to implement a permanent change for CSP policy

 System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "default-src 'self'; style-src 'self' 'unsafe-inline';")

Without this the CSS is rendered incorrectly. Again to change this is done in /lib/systemd/system/jenkins.service.

 Environment="JAVA_OPTS=-Djava.awt.headless=true -Dhudson.model.DirectoryBrowserSupport.CSP=\"default-src 'self'; style-src 'self' 'unsafe-inline';\""