views:

609

answers:

8

Whenever I notice that something in my workflow is a repeating task, I try to automate it.

For example the steps necessary to deploy something on a server. It's often a build, followed by a scp and finally some remote setup scripts:

  1. mvn package
  2. scp target/foobar.jar server:
  3. ssh server install-foobar
  4. ssh server './bin/foobar restart'

I tend to write a small Makefile in such cases, which could look like

  deploy:
      mvn package
      scp target/foobar.jar server:
      ssh server install-foobar
      ssh server './bin/foobar restart'

How do you automate your workflows?
Is Ant the tool of choice? What are the Pros/Cons?

+1  A: 

Rake is my choice.

PEZ
+1  A: 
Michael Borgwardt
ant-contrib can be used to easily add loops to ant scripts.
Adam Peck
A: 

I find Ant and its XML configuration syntax a bit unwieldy and there are some things that should be trivial but are very hard to get in Ant. I prefer for that kind of automation SCons.

There is another tool precisely made to deploy stuff that I used for a bit and was pretty cool, but I forgot its name, maybe somebody else remembers it :).

Vinko Vrsalovic
+1  A: 

SCons is another good one. And Capistrano seems to be well regarded although I haven't tried it.

Charlie Martin
+1  A: 

I use shell and perl scripts

andreas buykx
+1  A: 

consider GAnt (http://gant.codehaus.org/). using Groovy's builder, it is much less verbose than an Ant build script

Ey, this look fantastic!
PEZ
A: 

I use scripts (shell, perl, python) or makefiles. I do not like Ant and SCons

Helltone
+1  A: 

For python I tend to use fabric for the deployment steps and setuptools for any building that is needed (not that usual for me :-)

Fabric understands how to copy files to servers, runing commands on the remote server (both as the standard user and as root).

Mr Shark