Anurag
Anurag

Reputation: 141889

Writing an entire application on top of Capistrano

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.

Upvotes: 2

Views: 276

Answers (2)

Lee Hambley
Lee Hambley

Reputation: 6370

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 )

Upvotes: 1

zed_0xff
zed_0xff

Reputation: 33227

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.

Upvotes: 1

Related Questions