Jenkins

Tango-document-new.png

Tango-document-new.png

This article is a stub.

Notes: 99% of this article is about creating a launcher script that should probably better be contributed upstream, although server applications shouldn't have to be run manually often, and a shell alias would do the job in a simpler way for testing. (Discuss in Talk:Jenkins#)

Jenkins is a continuous integration server: basically it is a Java application that helps manage web applications. Note that applications do not have to contain any Java themselves, so you can benefit from it for PHP applications, Node.js, etc.

Installing

Install jenkins.

Configuring

The configuration file is located in /etc/conf.d/jenkins, open this file and look it over:

 JAVA=/usr/bin/java
 JAVA_ARGS=-Xmx512m
 JAVA_OPTS=
 JENKINS_USER=jenkins
 JENKINS_HOME=/var/lib/jenkins
 JENKINS_WAR=/usr/share/java/jenkins/jenkins.war
 JENKINS_WEBROOT=--webroot=/var/cache/jenkins
 JENKINS_PORT=--httpPort=8090
 JENKINS_AJPPORT=--ajp13Port=-1
 JENKINS_OPTS=
 JENKINS_COMMAND_LINE="$JAVA $JAVA_ARGS $JAVA_OPTS -jar $JENKINS_WAR $JENKINS_WEBROOT $JENKINS_PORT $JENKINS_AJPPORT $JENKINS_OPTS"

Notice the location of the war file. Change to this directory, then run jenkins from there.

Creating automated script to start jenkins

Create a new file with the following content:

/usr/local/bin/startjenkins
#!/bin/bash
echo
echo starting jenkins now
java -jar /usr/share/java/jenkins/jenkins.war

You can also use /usr/local/share, depending on what is already in your path, you can run echo $PATH to find this information.

Change its permissions:

# chown yourusername:users /usr/local/bin/startjenkins
# chmod 655 /usr/local/bin/startjenkins

Running

If you have added the startjenkins file to a directory that is in your path, all you need to do to run it with the following command:

$ startjenkins

Otherwise you will need to run it directly from its actual location:

$ java -jar /usr/share/java/jenkins/jenkins.war

Accessing

You can now log into your jenkins at http://localhost:8080.