ColdFusion, Ant and Subversion = AntFarm Build Manager

I have beeen working on a little ColdFusion application at work that will allow us to quickly create builds of our applications and move them to the dev/staging server for us to prepare for testing by our QA team. I have to admit I put off learning Ant for a long time but now I am SO glad that I did.
I got started playing with Ant based on a suggestion from Sean Corfield. I was asking Sean if there were any ways to checkout a copy of the latest code from Subversion and copy it to our dev server without having to do it manually and he quickly pointed me to Ant.So this little application Im calling AntFarm houses configurations of all of our projects and allows you to quickly create builds and deploy them. Its actually coming in quite handy since we have multiple developers all contributing to the same projects in subversion. Here are the features so far:

  • Holds configs for multiple projects
  • Checks code out from your subversion repository based on the project
  • Cleans up the code removing and unwanted files like .project files that somehow always find their way into subversion
  • Dynamically creates the version for the project and appends the subversion revision number to the build
  • Creates a tag in your subversion repository named with the appropriate version
  • Deploys the code to your deployment path (currently only works on local and mapped directories)
  • The project list shows you the latest build version and allows you to open the ant log for that build.
  • Allows use of your own custom build files or use the prepackaged one

Thats about all I can think of for now. Im really wanting to release this as opensource for everyone to modify as they see fit but I have to make sure that my boss doesnt mind since some of it was written on company time. Im sure he will be ok with it.
Its written on CF7 using Fusebox 5 so you will need to install the Fusebox framework as well as the latest version of ant in order to run it.
Heres a little snippet from the build.xml file that I will include with AntFarm. This gets the revision of the checked out code and then writes that to a file. Then I use the REPLACE task to replace that revision number with the full buildversion property. Its really quite nat!


And thats really all there is to that. I will post somemore tomorrow once I make sure its ok to release it.

5 thoughts on “ColdFusion, Ant and Subversion = AntFarm Build Manager”

  1. I’m looking for a way to automate the deployment of my website (which includes some Coldfusion, and some static pages), from my development box to my staging server. It sounds like I’m in a similar situation as you. I’ve been hesitant to learn ANT, because it looked like a tool to build and deploy Java, but what you’ve said here makes me think that I could use it to deploy any contents of my Subversion repository (Coldfusion , HTML, some js) over to the staging server. Do I understand this correctly?

    I’m really interested in looking at your project here (seen on RIA Forge), but I won’t have time until closer to the holidays. I’d probably do it sooner, but I don’t have the Fusebox framework setup on my servers yet, so there are a few steps to prep before I’m ready.

  2. Thats exactly right! You can deploy any contents of your subversion repository. With a little customization of the build.xml file that comes with AntFarm, you could even change values in some of those files at deploy time or pull resources from other locations and include in the delpoyment if you want.

    AntFarm is just an easy interface for setting up the projects and creating the builds. It eliminates the need to know everything about Ant. Aside from setting up a few Envrionment vars, setting up Ant is dirt simple. Then AntFarm can be used to control the build process.

    There are stil a lot of features to be added but as it stands now, it would do what you want.

  3. Would it copy updated image files such as jpg and gifs (we don’t have many) as well, or do I look for another method of copying the images seperately?

  4. It will copy any of the files you need. We keep all of our images and everything in our SVN repository and AntFarm just pulls the latest copies when it creates a build.

    If you keep your images in another location say on a file server, then you can customize the included Ant script to copy them into your build directory before you deploy the build.

  5. Russ,
    I have a great need for this at work as well. We have the same standard setup. Dev on local, staging server and production server.
    Would be nice if you could include a litte more info to get a person up and running. Could you please include or send me the SQL script
    for MS SQL. At the very least,the column names and datatypes. The download at RIAforge has no sql script or db info.
    Would be greatly appreciated.

    Thanks
    Gman

Leave a Reply

Your email address will not be published. Required fields are marked *


*