Sunday, June 17, 2012

Jenkins

Tested Versions:

Official documentation:
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins

 

A. Install:

1. Add the Jenkins repository:

#---
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
#---

2. Install the packages:

#---
yum -y install \
jenkins \
xorg-x11-server-Xvfb
#---

3. Start and check the server:

#---
/etc/init.d/jenkins start
#---

Check at the url below:
http://localhost:8080/

B. Make it run permanently as a stand-alone daemon:

#---
chkconfig --level 345 jenkins on
#---

4. Network problems:

In case your network does not work properly try adding the following line to your Jenkins setup file [/etc/sysconfig/jenkins]:

JENKINS_JAVA_OPTIONS="${JENKINS_JAVA_OPTIONS} -D-Djava.net.preferIPv4Stack=true"

5. Important files:

Configuration:
/etc/sysconfig/jenkins
Logs:
/var/log/jenkins/jenkins.log

C. Running on an existing Tomcat instance:


1. Stop any running stand-alone Jenkins instance

#---
/etc/init.d/jenkins stop
#---


2. Do not let Jenkins start automatically as a daemon:

#---
chkconfig --level 345 jenkins off
#---


3. Deploy Jenkins application:

#---
cp /usr/lib/jenkins/jenkins.war /var/lib/tomcat/webapps/
#---


4. Restart and enable Tomcat as service:

#---
systemctl restart tomcat.service
#---

#---
systemctl enable tomcat.service
#---


5. Check if it is running:

http://localhost:8080/jenkins/


6. Log files:

/var/log/tomcat/catalina.out
/var/log/tomcat/*

7. Network problems:

In case your network does not work properly try adding the following line to your TomCat setup file [/etc/tomcat/tomcat.conf]:

JAVA_OPTS="-Djava.net.preferIPv4Stack=true"

No comments: