So we asked a developer to merge these two scripts and thought that would be it. On the day we did the deployment to DEV, the services refused to start. Reason - corrupted files. We switched to plan B - used the old scripts and viola! the services start!
We duly fired a failure mail and decided to dissect things the next day. And after half a day when I figured it, I kicked myself.
Ant has a copy task that lets you perform token replacement. This basically lets you prepare files that can vary depending on environment etc and set the values when building the script. This is how it is used
< copy todir='../backup/dir'>
< fileset dir='src_dir'/>
< filterset>
< filter token='TITLE' value='Foo Bar'/>
< /filterset>
< /copy>
Apparently, this task does not differentiate between ASCII and binary files. It does the replacement on ANY file. Our original scripts were separate. So the jar files were copied in a copy task that did not do filtering. When we merged the scripts, we put all the files into a single task.
Once I moved the jar files and the property files into separate tasks, the scripts worked fine.
So it was a simple Ant task that was the issue!!

0 comments:
Post a Comment