Installing and Configuring Jenkins Build Server
Jenkins is an "extensible continuous integration server". It monitors repeated executions of jobs, such as building software projects, and can be used to build WebObjects applications and frameworks. Jenkins is an open source project and can be used at no cost. It is hosted on Github.com.
An introductory presentation on building WebObjects projects with Hudson (the predecessor to Jenkins) was given by Mike Schrag at WOWODC-West in 2009, and the video can be purchased from wocommunity.org.
Upgrading from Hudson
Switching from Hudson to Jenkins is straight-forward since Hudson was the foundation that Jenkins was forked from. jenkins-ci.org has a wiki entry to help with the change.
Stand-Alone Mac OS X Setup
- Download the Jenkins Binary Installer from the Jenkins Website.
The direct link to get the latest installer is: http://mirrors.jenkins-ci.org/osx/latest. This will download a standard OS X Installer Package named jenkins-n.nnn.pkg. - Run the installer
- Restart your computer
This is required because the current version of Jenkins does not create the its directory until it launches after you restart you computer. - Point your browser to: http://localhost:8080/
- Start setting up jobs (Instructions from WOWODC2011 Coming Soon)
Stand-Alone CentOS/RedHat/Amazon Linux
The easiest way to install Jenkins on a Fedora/RedHat/CentOS/Amazon Linux is by using Yum. The Jenkins project have a Yum repository and complete instructions on how to add the repository + install Jenkins the first time.
You can also manually install Jenkins from a RPM. To do so:
- Download the Jenkins Binary Installer from the Jenkins Website.
- If using the .rpm, install it with
rpm -install jenkins-VERSION-NUMBER.noarch.rpm - To start Jenkins:
service jenkins on - Point your browser to: http://yourserver:8080
- The Jenkins data directory, where the jobs and config are, is : /var/lib/jenkins
The starting script is at: /etc/init.d/jenkins
Jenkins (the .war) is installed at: /usr/lib/jenkins/ - To upgrade Jenkins, do the same step as installation, but do -upgrade instead of -install:
rpm -upgrade jenkins-VERSION-NUMBER.noarch.rpm
Using SSL
Setting up SSL for Jenkins is surprisingly easy. The following is originally from the SSL Setup Options page on nabble.com:
- Create a selfsigned test SSL certificate.
keytool genkey keyalg RSA alias selfsigned keystore keystore.jks -storepass ToPSecRet321 dname "cn=localhost" - Launch Jenkins.
Unknown macro: noformat. Click on this message for details.
- Launch browser
Open "https://localhost:8080" in browser. You might get a browser warning, because the certificate is not signed by a known certificate authority. Communication is SSL-encrypted nevertheless.
Servlet Container Installation on Mac OS X (10.5, 10.6)
- Install Tomcat from http://www.macports.org with the command
Unknown macro: noformat. Click on this message for details.
- Create an administrative user in /opt/local/share/java/tomcat6/conf/tomcat-users.xml.
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="admin,manager"/>
</tomcat-users>
Don't forget to change the username and password after you have finished checking out the build server and start using it in production.
- Start Tomcat.
Unknown macro: noformat. Click on this message for details.
- Download Jenkins, saving jenkins.war somewhere for later.
- Create a folder for Jenkins to work in: /opt/local/var/db/jenkins
- Change ownership of that folder: chown www:_www /opt/local/var/db/jenkins
- Add the following to /opt/local/share/java/tomcat6/conf/setenv.local:
Unknown macro: noformat. Click on this message for details.
- Install Jenkins in Tomcat: go to http://localhost:8080, login with the user and password that you have created in tomcat-users.xml, and upload jenkins.war to the Tomcat server.
- Goto http://localhost:8080/jenkins and you can start configuring your Jenkins build server.
Unknown macro: color. Click on this message for details.
- Tomcat is by default installed on Mac OS X Server.
- Create an administrative user in /Library/Tomcat/conf/tomcat-users.xml.
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="admin,manager"/>
</tomcat-users>
{color:#000000}Don't forget to change the username and password after you have finished checking out the build server and start using it in production. {color}
- The way to start it depends on the version. The current way is to go to the Web Settings in Server Admin, Settings, General, check the Tomcat checkbox. Restart the WebServer.
- Download Jenkins, saving jenkins.war somewhere for later.
- Create a folder for Jenkins to work in: /Library/Jenkins
- Change ownership of that folder: chown appserver:sys /Library/Jenkins
- Add the following to /Library/Tomcat/bin/setenv.sh:
export JENKINS_HOME=/Library/Jenkins
export JAVA_OPTS=-Djava.awt.headless=true
- Make sure that you are using UTF-8 in the Connector, by adding URIEncoding="UTF-8" to the Connector in /Library/tomcat/conf/server.xml as shown here:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
- Install Jenkins in Tomcat: go to http://localhost:8080, login with the user and password that you have created in tomcat-users.xml, and upload jenkins.war to the Tomcat server.
- Goto http://localhost:8080/jenkins and you can start configuring your Jenkins build server.
Building WO Apps
- Check out sh
Jenkins
After Jenkins is installed and started, you will need to install at the very minimum two plugins: Multiple SCMs and Git. They are required if you need to build projects by using the WOJenkins templates. If your projects are under another SCM like Subversion or CVS, you also need to install Jenkins for it.