views:

160

answers:

4

Hello, I'm trying to make sense on the best way to do automatize a series of things in a row in order to deploy a web-app and haven't yet came up with a suitable solution. I would like to:

  1. use google's compiler.jar to minify my JS
  2. use yahoo's yui-compressor.jar to minify my CSS
  3. access a file and change a string so that header files like "global.css?v=21" get served the correct version
  4. deploy the app (sftp, mercurial or rsync?) omitting certain directories like "/userfiles"

Can you guys put me on the right track to solve this?

Thank you!

A: 

I generally run Python projects so this may or may not be an option for you: but apart from writing your own scripts you could look into the following:

digitaldreamer
+4  A: 

you may want to check out phing http://phing.info/ (they are in the process of moving servers so may be down this weekend), but it can do all of what you are wanting and is written in php. A quick google search should bring up plenty of tutorials to get you started.

Steve Robillard
@Steve Robillard I've been playing around with Phing and haven't yet made it do all the things I wished for but it does seam like the way to go. One thing I did find lacking was recursive SCP support.I'll probably go with rSync: http://www.fedecarg.com/projects/show/filesynctask
Frankie
Frankie you may want to look at the exec task or check the doc on writing a custom task.
Steve Robillard
+3  A: 

You can run php from the command line to do all sorts of fun things.

$ php script_name.php arg1 arg2

See: command line, argv, argc, exec

Running PHP from the command line is very fast. I've been doing this a lot lately for various automation tasks.

banzaimonkey
Didn't know that. Cool.
Josh Pinter
A: 

As mentioned in previous answers, this of course can be done with scripts. But, if you're going to be doing many and frequent deployments, on many servers, where there are small changes between each deployment, then scripting won't scale and can not be managed. It will become almost impossible to add tier dependencies to your scripts, and user management (who can run what and on what servers/environments) will become a nightmare.

There are a few commercial companies that are attacking this problem (called Application Service Automation). For Java there's Phurnace, what was recently acquired by BMC. If you're in the cloud, there's R Path. For physical, virtual, and cloud environments (even combined) there's Nolio. They have a free version at http://www.nomorescripts.com, and more information can be found at http://www.noliosoft.com .

I see this question getting asked more and more often, which very much remind me of the days where testing was also done manually and with scripts before Mercury Interactive came up with Testing Automation. Time to do the same for application release and deploy automation.

Daniel Kushner