Showing posts with label continuous integration. Show all posts
Showing posts with label continuous integration. Show all posts

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"

Saturday, May 12, 2012

Apache Continuum

This is aimed at installing and configuring Apache Continuum. The reason is that I already have some (awful and disgusting) experience with CruisControl. I ended up writing an Eclipse integration plug-in and a LOT of Ant scripting and I'm not very keen of repeating this experience. I also have had some experience with Hudson/Jenkins which was not that great (even though a LOT better than CruiseControl). Therefore I'm willing to take Continuum for a ride and see how it goes. Since I didn't documented the previous experiences I'm doing it for Continuum.

This documentation was tested with version 1.3.8(GA) available at http://continuum.apache.org/download.html and based on the official documentation available at http://continuum.apache.org/docs/1.3.8/

 

1. Get Apache Continuum (it is not distributed in RPM).

 

1.1. Get version 1.3.8 GA in bin.tar.gz from http://continuum.apache.org/download.html

#---
wget http://www.apache.org/dyn/closer.cgi/continuum/binaries/apache-continuum-1.3.8-bin.tar.gz
tar -vxzf apache-continuum-1.3.8-bin.tar.gz -C /opt/
#---


2. Get Java environment right:

 

2.1. Check your environment variables:

#---

env | grep JAVA_HOME
#---

 

2.2. Install Java (openjdk will do):

#---

yum -y install \
java-1.6.0-openjdk
#---


2.3. Check your Java version:

#---

java -version
#---


OpenJDK:
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (fedora-65.1.11.1.fc16-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)


Sun:
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

 

2.4. Set JAVA_HOME variable correctly:

 

2.4.1. For OpenJDK:

#--- 

cat >> /etc/environment <<__END__

JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64
__END__
#---

 

2.4.2. For Sun's Java:

#---
cat >> /etc/environment <<__END__
JAVA_HOME=/usr/java/default/
__END__
#---


NOTE: It will take effect on the next login

3. Run Continuum for the first time to check it out:

#---

/opt/apache-continuum-1.3.8/bin/continuum start
#---


3.1. Track startup through its log file: /opt/apache-continuum-1.3.8/logs/continuum.log

#---

tail -f /opt/apache-continuum-1.3.8/logs/continuum.log
#---


NOTE: It should yield an exception complaining about security configurations:

org.apache.commons.configuration.ConfigurationException: Cannot locate configuration source ./conf/security.properties


3.2. It goes up nonetheless and you can open it: 3.3. Go through the admin setup and try to create a remote project.

http://localhost:8080/continuum/

My setup is the default (I didn't changed it)


4. Try it with a remote project. I chose the Continuum project (~15MB):

 

4.1. Go to Continuum and add two Maven 2 project: 

http://localhost:8080/continuum/

Add Project -> Maven 2.0.x Project

Parent (must be the first to be added):
http://svn.apache.org/repos/asf/continuum/parent/trunk/pom.xml
Continuum:
http://svn.apache.org/repos/asf/continuum/trunk/pom.xml


5. For local repositories you need to enable the file protocol. Check the procedures on the FAQ page:



URLs and instructions from:
http://continuum.apache.org/development/building.html

http://continuum.apache.org/faqs.html

Particularly at:
http://continuum.apache.org/faqs.html#can-i-use-file-protocol-in-add-project-view