Skip to content

Instantly share code, notes, and snippets.

@weshouman
Last active October 28, 2017 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weshouman/2114717b38caae311211 to your computer and use it in GitHub Desktop.
Save weshouman/2114717b38caae311211 to your computer and use it in GitHub Desktop.
Customizing/using Jenkins #jenkins

Restart jenkins

That's how we restart jenkins service.

sudo service jenkins restart

Jenkins defaults

Are stored in /etc/default/jenkins.
Example: the default port named HTTP_PORT.

Note: we need to restart after making changes:
Example

sudo nano /etc/default/jenkins
sudo service jenkins restart

Git timeout of a project

Follow project -> Configure -> Additional Behaviours (sections) -> add button -> advanced clone options -> insert the new timeout value

Change workspace directory

[Jenkins change workspaces and build][1] article.

[1] http://ingorichter.blogspot.com/2012/02/jenkins-change-workspaces-and-build.html

Default workspace

The default workspace is written in /etc/default/jenkins with the tag "JENKINS_HOME" mine was JENKINS_HOME=/var/lib/jenkins.

Change workspae

We can change the workspace per project through the "Advanced Project Options" section -> Use Custom Workspace option.

To change the WORKSPACE we'll need to ensure that jenkins is the owner of the workspace out of /var/lib/jenkins ... by chown to jenkins

sudo chown jenkins -R master_directory
sudo chown jenkins -R build_directory

GUI application execution

To execute any gui application we must ensure the $DISPLAY and $XAUTHORITY have the right variables and $XAUTHORITY's path is accessible by jenkins ... for me the $DISPLAY was ":0" ... and $XAUTHORITY was "/home/walid5/.Xauthority" ... which had the permission set to 600, I had to change it to 644 so that jenkins can access it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment