Abhi, You'll need rake to do what you need to do, but there is nothing to stop you using either Net::SSH or Capistrano to instruct your server to run this task from your wosktation.
As a bonus point, for you - Rake and Capistrano have very similar interfaces, and both share an incredibly similar DSL in which you define your tasks. I imagine, for a start, learning Ruby, you'll want to take a look at the following libraries - http://www.ruby-doc.org/core/classes/FileUtils.html - http://www.ruby-doc.org/core/classes/File.html - "Perform Basic MySQL Stuff" - http://www.kitebird.com/articles/ruby-mysql.html (tricky to use....) - Shell out using Open3 to run the system mysql commands. - http://www.ruby-doc.org/stdlib/libdoc/open3/rdoc/index.html - "Create a Sub-Domain" - there is a lot more to that, so I can't even suggest what libraries might help you do this, if you are running your own name servers, you can probably do this with http://net-dns.rubyforge.org/ I hope these few links help, and they are some of the tools that a Ruby progreammer (not specifically Rails) might use every day; investing time in learning them now will pay dividends. - Lee 2009/4/27 Abhi <[email protected]> > > Lee: Yes, I need to run this on server. > > Mathias: Thanks for your reply. It was helpful. I guess I'll try some > Rake. > > > > On Apr 27, 1:45 am, Mathias Meyer <[email protected]> wrote: > > On 26.04.2009, at 20:51, Abhi wrote: > > > > > > > > > Hi all, > > > > > I'm currently new to capistrano. After trying out various solutions > > > built in PHP - I found capistrano the best one. I'm using it to > > > automate a simple build process used by our team from a last few days. > > > > > Here's the process: > > > > > 1. Create a new directory called 'app' in directory as specified in > > > ":repository" variable. > > > 2. Checkout at this 'app' directory. > > > 3. After checkout, read a file called CAKE, which contains the rev. > > > number of CakePHP framework to be used. > > > 4. Depending on revision, copy it from another library directory (from > > > same server) > > > 5. Perform basic MySQL stuff > > > 6. Create sub-domain like: someApp.mydomain.com > > > 7. This subdomain should automatically point out to /current directory > > > > > Because I'm not a ruby player yet - I'm not sure how easy/hard it will > > > be to do with Capistrano. Please let me know what you guys think? > > > > Do you want to run all that stuff remotely? Capistrano is more of a > > "check out this code and do stuff with it" tool. What you describe > > sounds to me more like a job for writing a plain Rakefile (which you > > can then easily call remotely with Capistrano) for use with Ruby's > > build tool rake. In a Rakefile you can include libraries to e.g. talk > > to MySQL, and you can use Ruby's built-in file system support. I think > > this kind of script to run these administrative commands is more > > fitting. > > > > I think you'd be better off this way, since writing it in plain > > Capistrano run commands (calling shell commands in turn) would result > > in a pretty awkward code. > > > > Cheers, Mathias > > --http://paperplanes.dehttp://twitter.com/roidrage > > > --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
