views:

40

answers:

2

I am working on a task that needs to checkout source from a github repositroy, and then modify some files from the checked out repository based on some existing configuration data that's coming from a separate call to a different web service as JSON. The changes to the checked out code are temporary and will not be pushed back to github.

Once the checked out source is processed and modified based upon the configuration data, I will create a compressed archive of the resulting source.

I just discovered Capistrano and it seems great for this entire process, although it has nothing to do with deployment. On the other hand, I could simply use plain Ruby to do the same stuff. Currently, I am weighing more on the side of using Capistrano with custom tasks.

So you can say that it's an app based on Capistrano itself, with local deployment. Does it sound like a sane approach? Should I write it in plain Ruby instead? Or maybe write parts of the application in pure Ruby, and connect the pieces with Capistrano. Any suggestion is welcome.

+1  A: 

As for me, I write things like these in a Rakefile, and then use a rake command to call them.

You can find that Rakefiles are similar to Capfiles, so rake is usually used to perform some local tasks, and cap for remote.

zed_0xff
@zed - Rake is a good option too, although I think the remote tasks will far outweigh the local tasks for me, so going with cap makes more sense. Cloning a git repository and the other stuff (merging config with cloned repo's source) is trivial as well, using erb templates. Combining rake and cap is another option too, but I would prefer to keep things simple at this point.
Anurag
+1  A: 

Sincerely recommend Thor (see Github) it's pure-ruby syntax tax framework like Rake (but like Capistrano has a lot of cruft for server cluster grouping and connection handling… Rake has a lot to do with more classical "Make" or build tasks)

Recommendation from me is a set of Thor tasks, using raw-net-ssh (cap is based on Net::SSH) where appropriate.

For the checking out I recommend you watch the "Amp" project… they're coming up with a consistent cross-scm way to do checkouts (but thats the least of your problems) - You can take a look here, but it's early days for them yet - http://github.com/michaeledgar/amp

Sources: (as the Capistrano maintainer, i'm planning on throwing out our own DSL to replace it with Thor since it makes a lot more sense )

Beaks