As a disclaimer, I’d like to say that this article is not a 5 minute tutorial on how to use Ant, since www is full of such articles, Apache Ant web site being the best. The sole purpose of this article is to enlighten fellow enthusiasts with the hidden secrets about Ant that I have discovered.
Most of the projects use Ant for automating their build processes. These automation scripts are nothing but sequential processes of checking out from repositories, building, & deploying the project. Some other projects go a step further and combine the unit test process with this to check the integrity and validity of application. Few others configure automated functional tests to be triggered after a successful build and deploy. Some also combine Ant with other tools such as CruiseControl and Maven to achieve what they think is “build nirvana”.
**For beginners:
Maven is …
“.. A software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.”
http://maven.apache.org/
And CruiseControl is..
“Both a continuous integration tool and an extensible framework for creating a custom continuous build process.”
http://cruisecontrol.sourceforge.net/
**
Even though both of these are excellent tools and they deliver what they promise, still a lot of areas in terms of automation are left out which can be explored by inquisitive software automation believers like you and me!
Now let’s discuss some of the features which can revolutionize mundane tasks through automation:
Step 1
----------
Currently, whenever there is build failure most of the systems send an email to a distribution list and depend on the lead/developer to find out the problem and fix it. However there is a scope to automate here:
The automation could be achieved by writing listener/loggers which parse the failure message (from the build logs) to get the list of all the files which failed to compile. Now for each of this file we need to get a repository history and find out the last check in. This would give us the repository ID of the user which is mapped to an email id with the supervisor’s name. The build failure message goes to the intended developer with an expected time of resolution. As soon as that time passes out the build triggers again and if the problems still exist an email goes to the user as well has his/her supervisor.
Step 2
---------
“I was not checking my email”. Haven’t we heard that before? Well, not all of us have access to the emails at all times; neither can we be checking emails all the time. Won’t integrating Ant with SMS facility be an excellent idea?
As we all know most of the telecom service providers have a facility through which emails gets converted to SMSes, for example, if you send an email to 9198xxxxxxx98@airtellkarnataka.com , the mobile number owner will receive it as an SMS. Why not send important build related messages to intended recipients through this free and reliable service?
Step 3
-----
“Ping Pong” is something which can be achieved using Ant or any other automated script. In any enterprise web development environment there are servers which need to be up and running for testing purposes, although all the HA environments have mechanisms in place to keep these servers up to 99.99%. However development environments usually lack these features. An Ant script could come in handy here. The script could be configured to ping the server at regular intervals and wait for the reply, if there is no reply, the script can then notify the concerned party. The script could also be configured to bring up the server automatically!
Step 4
------
Using Ant to achieve Automated Check in. In a typical development project we all checkout code, modify and check it in at on a daily basis. What if each developer has an Ant script on his machine which checks-in the modified code at end of day automatically? This would simplify maintaining processes and standardize daily check ins.
To be continued….
0 comments:
Post a Comment