Ciaran Archer
Ciaran Archer

Reputation: 12446

Automated deployment using Ant or similar

I want to sort out out our deployment process and I was hoping to use Ant or a similar build tool to design and implement a one-click deployment of a specific SVN revision to multiple servers.

We use ColdFusion as our application server so we usually just upload a set of changed files to all our servers. There is no compile step.

The process would be as follows:

Is it possible to do this using Ant or are there better open source tools for the job? I'm interested in SVN intergration in particular.

I'd love to hear any experiences in this area. Thanks in advance.

Upvotes: 2

Views: 3268

Answers (2)

Nishant
Nishant

Reputation: 55866

If you are ready for a bit of learning, I would suggest you to switch to Maven and friends. Maven is basically makes the whole develop, test, deploy and manage very simple and reliable.

There are plugins that are going to help you in the whole process. SVN is intergrated with Maven so, you would not have any issues.

Here is short list

  1. Use Maven SCM plugin to checkout/export the code.
  2. Maven will perform specific build for you and package the code.
  3. Use Maven Cargo plugin to upload the packaged artifact/Jar/War to your server. You can restart the server as well.
  4. You have build-profiles in Maven, you can define build and deployment behaviors based on platform (Unix, Mac, Windows,...) and environments (dev, test, prod, etc).
  5. On release, you may want to bump-up the code version to next SNAPSHOT release. This is also automated in Maven.
  6. Maven's integration with Liquibase is just awesome. It makes your database changes to execute so reliably that you will find a difference. You will be managing DB changes same as your Java code. In small rollbackable pieces of change-sets gives a lot of confidence while working on production environment.

Upvotes: 1

CaseySoftware
CaseySoftware

Reputation: 3125

Yes, there are numerous sources on this one:

http://subversion.open.collab.net/articles/IntegratingSubversionIntoYourAntBuild.html

http://ant.apache.org/manual/Tasks/ftp.html or http://www.developer.com/java/print.php/998241

Also, I'm not sure what the equivalent is in the Cold Fusion world, but you should look into Unit Testing and a linting tool. A linting tool can check for invalid syntax and basic structures. The invalid syntax part is key.. because you can have the task stop if there's a problem as opposed to deploying known-broken code.

It's just a matter of setting up the individual targets (tasks) and stringing them together in the right order.

Upvotes: 4

Related Questions