This is a completely non-rails related question.
For my current client, I have to refresh oracle databases from
production source systems. Usually I just ssh in and ftp the exports
and run a stack of shell scripts I have one by one. The
"deployment" (or refresh, to be exact) scenario is always the same.
SRC = Production db box
TGT = Development db box
shutdown db (TGT)
shutdown app/web servers (NOT rails)
ssh into target:
===> copy latest export from SRC
===> drop objects in local dev db (TGT)
===> import db (TGT)
===> rebuild indexes (TGT)
===> clear app/web caches (TGT)
===> restart web/app (Tuxedo) (TGT)
===> Invoice the client :-)
Now, I can manage the very last step manually, LoL, but I'd like to be
able to automate the rest of the steps in this simple task using
capistrano running from my local windows machine (and perhaps leave
this setup for the client to run it later on after my contract is
finished?)
Is this something which is doable without too much pain and/or code
contortions? I'm getting the sense that it is, I saw the "Fortran
Farm" post below, so it gives me hope, but I'm wondering if I can use
Capistrano for something completely non-related to Rails or Coding/SVN
or what have you... (the boxes are HP/UX btw, but that shouldn't
matter too much I presume?)
Do I still need to setup the "required" parameters albeit as dummies
because most of them are meaningless in a non-developer non-rails
enviornment??
I have seen the slingshot rails-stack setup script (
http://svn.highgroove.com:8080/deployment/trunk/) , but I'm not sure
if can pick and choose and just use the capistrano parts which let me
do remote-ssh'ing with the local ruby-scripting-goodness for general
db/sysadmin tasks.
Any hints or pointers or comments by people already doing this sort of
thing would be appreciated!
Thanks,
Amr
Oh, but you can do all that and more. I had a shell script that
installed everything that I used to run, and then moved it all over to
ruby, executed using net/ssh (and through capistrano). You get for
free, commands like run and sudo (and can do things with their output
using net/ssh), including error recovery.
I would go ahead and start with capistrano as your base, just knowing
that you'll never use "deploy" or any of the standard recipes that are
automatically loaded. You can pretty much start with a clean
deploy.rb file to load any variables you want to pass. Jamis is
working on abstracting out the core-capistrano which is task based,
role-based command execution, but until then, you'll just have to use
it in a rails context.
For running that script, I often time just drop it in a base rails app
with nothing in it, but newer capistrano setups can use your global
/etc/capistrano.conf (don't quote me on that file name) for recipes
and tasks.
> Any hints or pointers or comments by people already doing this sort of
> thing would be appreciated!
Definitely dig through that script, and let me know if you have any
questions/problems. So many have been using, I setup a trac for it:
http://trac.highgroove.com/deployment
any feedback is appreciated, hope you get some good use out of 'em.
deprec and the railsmachine folk all have similar tools, too....
might be worth a look.
--
Charles Brian Quinn
self-promotion: www.seebq.com
highgroove studios: www.highgroove.com
slingshot hosting: www.slingshothosting.com
main: 678.389.9462 fax: 678.826.0969
Ruby on Rails Bootcamp at the Big Nerd Ranch
Intensive Ruby on Rails Training:
http://www.bignerdranch.com/classes/ruby.shtml
I think the core capistrano with sole focus on generic tasks would be
a boon for us sysadmins/dba types .
Thanks for providing me a starting point and the helpful hints, I will
post back my progress once I get something cooked for oracle database
cloning and refresh using capistrano
Thanks,
Amr
On Feb 5, 5:32 pm, "Charles Brian Quinn" <cbqu...@gmail.com> wrote:
- Jamis