Wiki source code of Installing and Configuring Jenkins
Last modified by Bastian Triller on 2012/08/24 19:38
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
123.1 | 1 | **[[Jenkins>>url:http://jenkins-ci.org/||shape="rect"]]** 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>>url:https://github.com/jenkinsci||shape="rect"]]. |
![]() |
37.1 | 2 | |
![]() |
123.1 | 3 | An introductory presentation on building WebObjects projects with Hudson (the predecessor to Jenkins) was given by Mike Schrag at WOWODC-West in 2009. You can also have a look at a [[recording from WOWODC 2009 East>>url:http://www.wocommunity.org/podcasts/wowodc/east09/WOWODC09E-MultipleVersionsWO.mov||shape="rect"]]. |
![]() |
100.1 | 4 | |
![]() |
119.1 | 5 | === Pre-requirements === |
6 | |||
7 | Before you install Jenkins, you will need to install | ||
8 | |||
9 | * a Java SDK (a JRE won't work because of Ant) | ||
![]() |
123.1 | 10 | * a Git client. Make sure that the 'git' command is in the regular PATH (in /usr/bin or /usr/sbin). If it's elsewhere, like /opt/local/bin/git or /usr/local/bin/git, make a symlink in /usr/bin (example: sudo ln -s /opt/local/bin/git /usr/bin/git). |
![]() |
119.1 | 11 | * a Subversion client if you are going to use Subversion |
12 | |||
![]() |
116.1 | 13 | === Upgrading from Hudson === |
![]() |
64.1 | 14 | |
![]() |
123.1 | 15 | 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>>url:https://wiki.jenkins-ci.org/display/JENKINS/Upgrading+from+Hudson+to+Jenkins||shape="rect"]] to help with the change. |
![]() |
64.1 | 16 | |
![]() |
116.1 | 17 | === Stand-Alone Mac OS X Setup === |
![]() |
90.1 | 18 | |
![]() |
123.1 | 19 | 1. Download the Jenkins Binary Installer from the [[Jenkins Website>>url:http://jenkins-ci.org/||shape="rect"]]. |
20 | The direct link to get the latest installer is: [[http:~~/~~/mirrors.jenkins-ci.org/osx/latest>>url:http://mirrors.jenkins-ci.org/osx/latest||shape="rect"]]. This will download a standard OS X Installer Package named {{code language="none"}}jenkins-n.nnn.pkg{{/code}}. | ||
![]() |
116.1 | 21 | 1. Run the installer |
![]() |
123.1 | 22 | [[image:attach:JenkinsInstaller.png]] |
![]() |
116.1 | 23 | 1. Restart your computer |
![]() |
123.1 | 24 | This is required because the current version of Jenkins does not create the its directory until it launches after you restart you computer. |
25 | 1. Point your browser to: [[http:~~/~~/localhost:8080/>>url:http://localhost:8080/||shape="rect"]] | ||
![]() |
125.1 | 26 | 1. [[Start setting up jobs!>>doc:documentation.Home.Deployment.Using Jenkins Build Server with WebObjects Projects.Installing WebObjects and Wonder for Jenkins using WOJenkins.WebHome]] |
![]() |
92.1 | 27 | |
![]() |
116.1 | 28 | === Stand-Alone CentOS/RedHat/Amazon Linux === |
29 | |||
![]() |
123.1 | 30 | The easiest way to install Jenkins on a Fedora/RedHat/CentOS/Amazon Linux is by using [[Yum>>url:http://en.wikipedia.org/wiki/Yellow_dog_Updater,_Modified||shape="rect"]]. The Jenkins project have a Yum repository and [[complete instructions>>url:https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+RedHat+distributions||shape="rect"]] on how to add the repository + install Jenkins the first time. You can also manually install Jenkins from a RPM available on jenkins-ci.org. |
![]() |
116.1 | 31 | |
32 | Please note that on CentOS 5.x (I don't know for CentOS 6), the list of root certificates is old, and you will get error when trying to clone a Git repository coming from GitHub. To update the list of root certificates, do: | ||
33 | |||
![]() |
92.1 | 34 | {{code}} |
35 | |||
![]() |
116.1 | 36 | sudo cp /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt.original |
37 | sudo curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt | ||
![]() |
92.1 | 38 | |
39 | {{/code}} | ||
40 | |||
![]() |
116.1 | 41 | === Stand-Alone Ubuntu/Debian === |
![]() |
92.1 | 42 | |
![]() |
123.1 | 43 | Follow [[the following instructions>>url:http://pkg.jenkins-ci.org/debian/||shape="rect"]] to get Jenkins running on a Ubuntu or Debian system. If you didn't install a Sun JVM before installing Jenkins from their repository, it will install OpenJDK 1.6. [[Check the Ubuntu documentation>>url:https://help.ubuntu.com/community/Java||shape="rect"]] for details on how to install a JDK on Ubuntu. |
![]() |
98.1 | 44 | |
![]() |
119.1 | 45 | === Post installation === |
46 | |||
47 | After Jenkins is installed and running, go into Jenkins configuration and make sure that you install the "Multiple SCMs" and "Git plugin". If you are using another SCM like Mercurial or Perforce, install the plugins and the clients for your SCM. | ||
48 | |||
![]() |
116.1 | 49 | === Using SSL === |
![]() |
98.1 | 50 | |
![]() |
123.1 | 51 | Setting up SSL for Jenkins is surprisingly easy. The following is originally from the [[SSL Setup Options>>url:http://jenkins.361315.n4.nabble.com/SSL-Setup-Options-td954261.html||shape="rect"]] page on nabble.com: |
![]() |
98.1 | 52 | |
![]() |
123.1 | 53 | 1. Create a selfsigned test SSL certificate. |
54 | keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass ToPSecRet321 -dname "cn=localhost" | ||
55 | 1. Launch Jenkins. | ||
56 | 1. {{noformat}}java -jar jenkins.war --httpPort=-1 --httpsPort=8080 --httpsKeyStore=keystore.jks --httpsKeyStorePassword=ToPSecRet321{{/noformat}}Launch browser | ||
57 | 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. | ||
![]() |
116.1 | 58 | |
59 | {{note title="Please Note"}} | ||
60 | The port has changed from the original instructions. That was required on Mac OS X because of permissions. Also, it's worth noting that the keytool asks for a second password for the private key of the ssl certificate. We are using the same password as the keystore password and everything works. It is unclear if that makes a difference. | ||
61 | {{/note}} | ||
62 | |||
![]() |
108.1 | 63 | === Servlet Container Installation on Mac OS X (10.5, 10.6) === |
![]() |
92.1 | 64 | |
![]() |
123.1 | 65 | 1. Install Tomcat from [[http:~~/~~/www.macports.org>>url:http://www.macports.org||shape="rect"]] with the command |
![]() |
125.1 | 66 | 1. {{noformat}}sudo /opt/local/bin/port install tomcat6{{/noformat}}Create an administrative user in {{code language="none"}}/opt/local/share/java/tomcat6/conf/tomcat-users.xml{{/code}}. {{code 0="xml"}}<?xml version='1.0' encoding='utf-8'?> |
![]() |
37.1 | 67 | <tomcat-users> |
68 | <role rolename="manager"/> | ||
69 | <role rolename="admin"/> | ||
70 | <user username="tomcat" password="tomcat" roles="admin,manager"/> | ||
![]() |
125.1 | 71 | </tomcat-users>{{/code}} |
![]() |
123.1 | 72 | 1. {{panel bgColor="#F7D6C1"}}Don't forget to change the username and password after you have finished checking out the build server and start using it in production.{{/panel}}Start Tomcat. |
![]() |
125.1 | 73 | 1. {{noformat}}sudo launchctl load -w /Library/LaunchDaemons/org.macports.tomcat6.plist{{/noformat}}[[Download Jenkins>>url:http://mirrors.jenkins-ci.org/war/latest/jenkins.war||shape="rect"]], saving {{code language="none"}}jenkins.war{{/code}} somewhere for later. |
![]() |
123.1 | 74 | 1. Create a folder for Jenkins to work in: {{code language="none"}}/opt/local/var/db/jenkins{{/code}} |
75 | 1. Change ownership of that folder: {{code language="none"}}chown _www:_www /opt/local/var/db/jenkins{{/code}} | ||
76 | 1. Add the following to {{code language="none"}}/opt/local/share/java/tomcat6/conf/setenv.local{{/code}}: | ||
![]() |
125.1 | 77 | 1. {{noformat}}export JENKINS_HOME=/opt/local/var/db/jenkins |
78 | export JAVA_OPTS=-Djava.awt.headless=true{{/noformat}}Install Jenkins in Tomcat: go to [[http:~~/~~/localhost:8080>>url:http://localhost:8080||shape="rect"]], login with the user and password that you have created in {{code language="none"}}tomcat-users.xml{{/code}}, and upload {{code language="none"}}jenkins.war{{/code}} to the Tomcat server. | ||
![]() |
123.1 | 79 | 1. Goto [[http:~~/~~/localhost:8080/jenkins>>url:http://localhost:8080/jenkins||shape="rect"]] and you can start configuring your Jenkins build server. |
![]() |
82.1 | 80 | |
![]() |
123.1 | 81 | === (% style="color: rgb(0,0,0);" %)**Servlet Container Installation on Mac OS X Server (10.6)**(%%) === |
![]() |
90.1 | 82 | |
![]() |
108.1 | 83 | 1. Tomcat is by default installed on Mac OS X Server. |
![]() |
125.1 | 84 | 1. Create an administrative user in {{code language="none"}}/Library/Tomcat/conf/tomcat-users.xml{{/code}}. {{code 0="xml"}}<?xml version='1.0' encoding='utf-8'?> |
![]() |
108.1 | 85 | <tomcat-users> |
86 | <role rolename="manager"/> | ||
87 | <role rolename="admin"/> | ||
88 | <user username="tomcat" password="tomcat" roles="admin,manager"/> | ||
![]() |
125.1 | 89 | </tomcat-users> {{/code}} |
![]() |
123.1 | 90 | 1. {{panel bgColor="#F7D6C1"}}(% style="color: rgb(0,0,0);" %)Don't forget to change the username and password after you have finished checking out the build server and start using it in production. {{/panel}}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. |
91 | 1. [[Download Jenkins>>url:http://mirrors.jenkins-ci.org/war/latest/jenkins.war||shape="rect"]], saving {{code language="none"}}jenkins.war{{/code}} somewhere for later. | ||
92 | 1. Create a folder for Jenkins to work in: {{code language="none"}}/Library/Jenkins{{/code}} | ||
93 | 1. Change ownership of that folder: {{code language="none"}}chown _appserver:sys /Library/Jenkins{{/code}} | ||
94 | 1. Add the following to {{code language="none"}}/Library/Tomcat/bin/setenv.sh{{/code}}: | ||
![]() |
125.1 | 95 | 1. {{code}}export JENKINS_HOME=/Library/Jenkins |
96 | export JAVA_OPTS=-Djava.awt.headless=true{{/code}}Make sure that you are using UTF-8 in the Connector, by adding {{code language="none"}}URIEncoding="UTF-8"{{/code}} to the Connector in {{code language="none"}}/Library/tomcat/conf/server.xml{{/code}} as shown here: | ||
97 | 1. {{code 0="xml"}}<Connector port="8080" protocol="HTTP/1.1" | ||
![]() |
116.1 | 98 | connectionTimeout="20000" |
![]() |
125.1 | 99 | redirectPort="8443" URIEncoding="UTF-8"/>{{/code}}Install Jenkins in Tomcat: go to [[http:~~/~~/localhost:8080>>url:http://localhost:8080||shape="rect"]], login with the user and password that you have created in tomcat-users.xml, and upload jenkins.war to the Tomcat server. |
![]() |
123.1 | 100 | 1. Goto [[http:~~/~~/localhost:8080/jenkins>>url:http://localhost:8080/jenkins||shape="rect"]] and you can start configuring your Jenkins build server. |
![]() |
114.1 | 101 | |
![]() |
116.1 | 102 | == Building WO Apps == |
![]() |
114.1 | 103 | |
![]() |
123.1 | 104 | * Check out[[attach:setupWorkspace.sh]] |
![]() |
114.1 | 105 | |
![]() |
116.1 | 106 | == Jenkins plugins == |
![]() |
114.1 | 107 | |
![]() |
123.1 | 108 | After Jenkins is installed and started, you will need to install at the very minimum two plugins: [[Multiple SCMs>>url:https://wiki.jenkins-ci.org/display/JENKINS/Multiple+SCMs+Plugin||shape="rect"]] and [[Git>>url:https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin||shape="rect"]]. 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. |
![]() |
114.1 | 109 | |
![]() |
117.1 | 110 | {{info}} |
![]() |
123.1 | 111 | Don't forget to set **Global Config user.name Value** and **Global Config user.email Value** in the Jenkins settings, or else doing a Git clone will return an error. |
![]() |
117.1 | 112 | {{/info}} |
113 | |||
![]() |
116.1 | 114 | == Building projects == |
![]() |
114.1 | 115 | |
![]() |
125.1 | 116 | See [[doc:documentation.Home.Deployment.Using Jenkins Build Server with WebObjects Projects.Installing WebObjects and Wonder for Jenkins using WOJenkins.WebHome]] |