| Beauty and the Beast: CruiseControl meets Cobol |
| Written by Stephen Callaghan |
| Friday, 08 February 2008 00:00 |
|
Continuous Integration with CruiseControl is a standard part of the development process here at Shine Technologies. All new projects kick off with a new build server and a CruiseControl install that calls out to the standard Ant build files and jUnit tests. Continuous Integration is a well proven process that both gets a new project up and running quickly and provides long-term support and infrastructure - even for legacy Cobol systems. At one of our corporate clients, we inherited the maintenance of a large production Cobol-based system. Although we have migrated many of the components to newer Java-based systems, there is still a sizeable component of both screens and batch jobs that we need to support. For its day (mid-1990s), it was a well-architected and designed system that has proved its worth and is still providing solid functionality to the client (how many modern systems currently being deployed do you really think will still be live in 12 years time!?). It uses standard makefiles that call out to the Cobol compiler, producing executables that can then be promoted from the development environment to UAT and then on to production. It's a challenge to keep support and development staff familiar with all the possible technologies that they may encounter on their day-to-day job, and yet still keep them competitively productive. The following diagram shows the workflow we introduced CruiseControl into: ![]() Note that this article assumes you are working in a Unix-like environment - Mac, Linux, HP-UX etc. In-principle it will work exactly the same on Windows - just not as nicely! Setting up CruiseControlThe latest releases of CruiseControl come with embedded web-servers, which make it trivially easy to setup and get productive very quickly.
CVS SetupTo allow CruiseControl to interact with CVS seamlessly, it is important to setup "password-less" checkouts as CruiseControl will checkout the latest version of code potentially many many times a day. We currently use extssh. Since this is over ssh, and relies on ssh authentication, this is the area that must allow password-less auth (there are many tutorials on the web, google it here). At a basic level you need to create a certificate, and then copy it to the machine you are trying to connect to.
Integration with "Make"Before the days of Ant, many of us had the "pleasure" of using make as our day-to-day build tool, leaving us with fond memories of hours lost fixing failures resulting from some whitespace not being a tab character. That said, at our client site we were fortunate to inherit some solid makefiles that do a good job of building all the needed components needed by the Cobol systems on the mainframe. So that a full build can become part of the CruiseControl process, we use Ant's exec command to call out to the existing make file. In the example below, we copy all the code checked out from CVS to the necessary Cobol source directory (again this eased integration as there was an existing well-defined Cobol build area that did not fit well with the CVS project containing the code so instead of forcing them to be compatible we simply checkout in one area and then copy over where it needs to go). Then we use exec to call out to the makefile, running it from the directory it needs to be called from \${src.batch} ![]() Promotion ScriptsThere are many proprietary solutions for managing software promotions between different development levels. They can be prohibitively expensive, especially if being fitted retrospectively. However, it is perfectly possible to build a robust solution that uses freely available tools. In our case we used Ant, ssh and bash. The following Ant script will deploy to UAT, stopping and starting servers as needed and archiving the old code. Note that it relies on the Ant ssh extension library. ![]() ConclusionAnd thats it! You should now have a Continuous Integration build of your old Cobol systems (or any other type of technology that has a command-line build file). Hopefully I've shown that it's relatively straightforward to retrospectively implement newer ideas and tools on older systems without having to make major adjustments or investments. And there are a number of key advantages:
Web Resources
|