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.
Contents
Installing
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
.