Table of Contents |
---|
...
Stoc |
---|
Continuous integration and continuous builds are mainstay features of modern software factories.
Continuous integration is the practice of development changes being tested, built, and reported in small increments during the development process. Continuous build is an extension of this practice to provide a newly tested build of the software every time a developer commits changes.
...
...
With these principles in mind, the developer's role in the continuous integration process can be summarized as follows. Developers should:
...
...
There are many different choices for continuous build software available, such as Jenkins, CruiseControl, Continuum, Bamboo, and others. The continuous build software chosen here is CruiseControl, as it is open source, has a no-cost license, and is well suited for Java applications.
CruiseControl is a free continuous build software package released as open source software. It is managed by ThoughtWorks, whose employees created the original version. It is well suited for Java based projects, and some of the more notable features include:
NOTE: These instructions are for a Windows installation.
CruiseControl can be downloaded at the following location: http://sourceforge.net/projects/cruisecontrol/files/. At this location, there are three options available:
These instructions will concentrate on using the Windows installer. The other two options are available if a more customized installation is desired or necessary.
Once the installation file has been downloaded, executing the installer should open a window
Select all the components. Next, the installer will ask for a location. This location should have sufficient rights for read/write
Clicking install will start the installation. After the installation is complete, there should be a folder containing the program contents
Also, if you open the Local Services control panel for the machine, there should be a service named "CruiseControl Service" available that has not been started yet. Go ahead and start the service to start CruiseControl.
CruiseControl ships with a default Java project named ConnectFour. When CruiseControl starts, it will try to build this project (using Ant) and return a result. To see if this has occurred, open the CruiseControl dashboard at the following location: http://<serveraddress_or_localhost>:8080/dashboard||||||\. The application dashboard will launch and you should see a screen like below
If the build has passed, then CruiseControl is configured and running properly in its default state.
Some troubleshooting tips if installation does not work:
As CruiseControl and Servoy are both Java driven applications, they share some Java technologies, and by default, share port configurations as well. If you plan to run CruiseControl and Servoy Application Server on the same machine, port changes will need to be made one application or the other in order for the applications to work properly.
NOTE: only one or the other needs to be modified, not both.
Changing ports for a Servoy Application Server installation is detail here (ADD LINK).
To change port configurations for CruiseControl instead, modify the wrapper.conf file found in the CruiseControl main folder. See the section below
...
.
This tutorial shows how to use Jenkins for the task at hand. There is also a sample page about using CruiseControl, but this one will not be updated in the future.
In regards to Servoy projects, Jenkins/CruiseControl is used to fill the following needs in our software factory
Jenkins/CruiseControl is are very flexible in how it they can be configured and the methods and strategies can differ depending on a variety of factors. In the case of using them with Servoy, we utilize their ability to run ANT scripts. With these ANT scripts, another tool in Servoy Developer exports the solution into a .servoy
file, then another ANT script runs a smart client based test client that will import the solution into a repository and run unit tests. Finally, if unit tests are passed, an export file is created in a folder - ready to be imported automatically into a test application server.
Rather than explain everything in detail that can be done with Jenkins/CruiseControl and a Servoy project, it is more beneficial to provide an example of Jenkins/CruiseControl and the supporting applications configured for a continuous build server.
The Building the Servoy Software Factory section will cover in detail setting up a continuous build server for a Servoy project.
Info |
---|
If trying this in a headless Linux, make sure to have an X11 (UI) installed (required by the import test client). Xvfb can be used for example, for those that are meant to be headless. |
Once we have a proper proper .servoy
file and it has passed unit testing (via our continuous build software), we would like to take it one step further and make the build available to the team for testing and use. This section talks about how to setup a Servoy Application Server to automatically import solutions.
...
At this time, there is no built in functionality to import import .servoy
files, nor is there any API available in the maintenance plug in for this functionality. It is possible to post to an application server and import a solution in that manner. An example solution for this has been provided at ServoyForge.importer solution is available at https://svn.servoy.com/examples/SoftwareFactoryUtils/trunk/AppServerUpdater
The importer solution will use the post the export file to the application server as if it were a web service. The solution import occurs, and the solution becomes available to the clients of that web server immediately. The import is triggered by changes to a a .servoy
file; when the file is changed via the build server process, an import occurs.
To use this solution, it is placed on an application server as ran as a batch processor. It takes one argument, the path and name of the file to import. A batch processor is started for each file to watch for changes. <Screenshot here>
The solution is open source and configurable, so if you need to make changes in . If any changes need to be made on how it operates to meet your needs, just open it in Servoy Developer and make any necessary changesthe necessary changes.
One change needed will be the Application Server address which the import is desired to occur on. Change the appServerAddress
variable in the importer scope to the correct address and port of the Application Server.
Another change is in the solutionOpen
method. Add the FileWatcher license code, available at http://servoy-plugins.de
Other changes can be made to the importSolution
method to adjust import settings if necessary.
This section is a guide to setting up a Servoy software factory.
...
The following information is a step by step guide to building a continuous build server. It includes a sample configuration for a sample set of sample solutions, as well as instructions on where to change this information for your solutions.
...
Create a folder for the software factory:
c:/SoftwareFactory
Install CruiseControl into the c:/SoftwareFactory/CruiseControl folder. Instructions
This is also a good time to make configuration changes to the wrapper.conf file Instructions To work in this environment, we need to change and add some lines to wrapper.conf for the run directory and classpath:
Add two lines right above the wrapper.java.classpath lines in the wrapper.conf
Code Block |
---|
wrapper.working.dir=c:/SoftwareFactory/workArea
set.CC_INSTALL=c:/SoftwareFactory/CruiseControl
|
Modify three lines as follows:
Code Block |
---|
wrapper.java.classpath.1=%CC_INSTALL%/lib/wrapper/*.jar
wrapper.java.classpath.2=%CC_INSTALL%/lib/*.jar
wrapper.java.library.path.1=%CC_INSTALL%/lib/wrapper
|
Tip | ||
---|---|---|
| ||
To avoid a bug that makes the dashboard not show build status, use Java 6 instead of 7; modify the following line to point to Java 6:
|
Save the wrapper.conf file.
SVNAnt is a helper application used by ANT to update projects from the SVN. Download the application from: http://subclipse.tigris.org/files/documents/906/49042/svnant-1.3.1.zip. Extract the contents of the zip file into c:/SoftwareFactory/svnant-1.3.1
We need an installation of Servoy Developer. Install Servoy Developer with the following options set
SVNAnt works better with a command line client. Recommended: slikSVN
Using the command line client installed, check out the solution (or solutions) from the SVN into the workspace file located at c:/SoftwareFactory/checkout/testrunner. For details on how to do this, please refer to the SVN client you have chosen.
If your SVN does not contain the solution yet, and you have the solution in a .servoy file, do the following:
As an alternative, you can use Servoy Developer to check out the solution. (NOTE: you will still need the command line client for operation of the software factory)
NOTE: If you are using a SSL repository, the SVN server certificate must be trusted. Otherwise, the software factory will fail.
A few items need to be configured at this point.
cruisecontrol.properties – a few items in this file need to be configured for your environment
...
Perform all steps in the guide on how to install Jenkins and configure it to automatically build and test Servoy Solutions that can be found here.
(alternatively, it is possible to set up CruiseControl using this guide - that will no longer be updated after Servoy 7.2 release)
If this is not done yet, install another instance of Servoy as an Application Server to act as the automatic build server. This can run the batch process for updating another Servoy Application Server, or it can just update itself and use it as the build server that holds the latest version of the software ready to be tested. Be sure to configure the ports accordingly so that there are no port conflicts.