Getting started with Continuous Integration
This blog follows my previous blog on why you should do continuous integration (CI). As CI is cool, nice, breath taking, helpful, you still have to find tools that support your CI activities. As I wrote in the above blog: CI is a set of tools.
Now, what kind of tools make sense? Which ones to use? Where and how to get started? Setting up a project that uses CI isn’t easy, and setting up the CI infrastructure should be very easy. Unfortunately, it is not always as easy as it should be, and in CI it starts already in selecting the right CI server. To experience the benefits or CI, nothing is better than learning by doing. To help you get started with CI I created a project on GitHub that helps you getting started.
The basic software stack is Jenkins, Sonar, SCM Manager, MySQL, Redmine, OpenDJ and Tomcat . The project hosted at GitHub is a simple ant script. It is not really optimized nor received some source code cleanup; it grew over the years on my laptop (have mercy). Starting the script downloads the software packages, then installs and configures each one of it. In the end you have a CI infrastructure ready to use.
The main configuration file is located under conf/project.properties. There you can define users, passwords, install paths and ports. The overall download is around 550 MB. To run the script, you need to have ant installed. Right now, the only platform the script will work is Windows 7 x64 (that’s because my Laptop is Windows 7 64 bit).
Start the installation: call the script install.bat
This will run a set of ant tasks. You can see the status in the shell. First task is to download the software components needed.
Then each component is installed and configured.
In the end you have to see a BUILD SUCCESSFUL.
After the script executed successfully (make sure the download task completes without errors and that every file is downloaded correctly) you start the server by calling startup.bat. This starts MySQL, OpenDJ and Tomcat. When tomcat is ready at localhost:port it’s time to check the setup.
Start the server
Start the framework: startup.bat
This will start the DB and LDAP server and then Tomcat in a new window:
You can follow the progress of the startup, initialization and configuration of the several web applications in the window. Here solr shows that it is using the correct work directory:
Here Jenkins found OpenDJ as the configured LDAP server:
Jenkins is installed correctly in Tomcat:
Redmine is configuring the MySQL database:
In the end, Tomcat is up and running.
The ports used by Tomcat are listed. Here, Tomcat is using port 9090 for HTTP.
Access the programs
Each program is installed in Tomcat and therefor can be accessed by entering the URL it is configured to run under.
Tomcat is accessible in the browser by calling the URL localhost:9090/
To call Jenkins: /jenkins and user / password: jenkins / jenkins.
To test Sonar: /sonar with user sonar / sonar
To test the source code management system: /scm with user scmadmin / scmadmin
To test redmine: /redmine with admin / admin or redmine / redmine
Everything should work and you can start exploring CI. Create projects that use SVN (or git), check them in, let Jenkins trigger a build and sonar analyze the code. Redmine is used to track bugs and changes. After the installation the CI framework is accessible under localhost, but can also be used from different computers.
Next: an ant script that is built on the above code that creates a SAP Portal PAR project.
 The software selection is based on what I know and normally use. I you want to use another software for a use case or want to add your own tool to the mix, feel free to do so. Other software is also included, but mostly because the install script is just an excerpt of a larger tool set I use for also bootstrapping portal applications.