I overwrite the migration task to target :roles => [:app], :once => true , have my db role set to :no_release => true, and I monkey patched support for :once at the task level.
https://gist.github.com/737474 So I no longer have to deploy code to the db server. On Dec 10, 2010, at 8:03 AM, ppgengler <[email protected]> wrote: > Don't the default rails recipes run the db:migrations task on the db > server, ergo you need the code deployed there too? I was always > curious what the Right Way (tm) to do that part of the deploy with > capistrano was: deploy the code to the db server and have it run > migrations, or don't deploy the code and modify the default recipes to > have a different machine do the migrations? > > Thanks, > \Peter > > On Dec 10, 6:51 am, Lee Hambley <[email protected]> wrote: >> no_release is used inside the default deploy.rb to decide which machines get >> the code checked out, it's not very intuitive, and I believe is only >> documented incidentally, a cursory look into the code in the deploy.rb which >> you are using (probably the default) would have cleared it up. >> >> Remember, Ruby is easy to read, and even complex software - looking in the >> source is often better than googling. >> >> - Lee >> >> On 10 December 2010 00:03, Wil Chung <[email protected]> wrote: >> >> >> >> >> >> >> >>> Wow, that worked. Thanks! >> >>> What's no_release? I saw it in the source for deploy recipes, but I >>> didn't see any documentation on it. >> >>> Where should I have looked in terms of documentation on no release? >>> Also, there doesn't seem to be tutorials on multiple server setups for >>> Capistrano. Is there one? >> >>> Wil >> >>> On Dec 9, 1:19 pm, Lee Hambley <[email protected]> wrote: >>>> In addition to the :primary => true, you have also to set :norelease >>>> => true on the db server entry, it may also be no_release I dnt >>>> remember off hand, I've just realised how counter intuitive that can >>>> be! >> >>>> Lee >> >>>> On Thursday, 9 December 2010, Wil Chung <[email protected]> wrote: >>>>> Hi all, >> >>>>> I'm stumped after scouring the web and all the documentation. I'm >>>>> hoping that someone can help here, since I feel like I'm just missing >>>>> something minor. >> >>>>> I have one application server and one database server. I have the >>>>> different roles pointing to different ip addresses, but "cap >>>>> deploy:update_code" wants to push the server code to the database >>>>> server for some reason. >> >>>>> I have a deploy script that has the following settings: >> >>>>> set :app_server, "67.207.xxx.xxx" >>>>> set :db_server, "67.207.yyy.yyy" >> >>>>> role :web, app_server >>>>> role :app, app_server >>>>> role :db, db_server, :primary => true >> >>>>> When I do a "cap deploy" or any of its children, like "cap >>>>> deploy:update", it wants to push my code to the database server at >>>>> 67.207.yyy.yyy, whereas, to my understanding, it should only push to >>>>> the app_server at 67.207.xxx.xxx >> >>>>> What should I do so that cap deploy only deploys to the application >>>>> server? >> >>>>> Wil >> >>>>> -- >>>>> * You received this message because you are subscribed to the Google >>> Groups "Capistrano" group. >>>>> * To post to this group, send email to [email protected] >>>>> * To unsubscribe from this group, send email to >>> [email protected]<capistrano%2bunsubscr...@googlegrou >>> ps.com>For more options, visit this group athttp:// >>> groups.google.com/group/capistrano?hl=en >> >>> -- >>> * You received this message because you are subscribed to the Google Groups >>> "Capistrano" group. >>> * To post to this group, send email to [email protected] >>> * To unsubscribe from this group, send email to >>> [email protected]<capistrano%2bunsubscr...@googlegrou >>> ps.com>For more options, visit this group at >>> http://groups.google.com/group/capistrano?hl=en > > -- > * You received this message because you are subscribed to the Google Groups > "Capistrano" group. > * To post to this group, send email to [email protected] > * To unsubscribe from this group, send email to > [email protected] For more options, visit this group at > http://groups.google.com/group/capistrano?hl=en -- * You received this message because you are subscribed to the Google Groups "Capistrano" group. * To post to this group, send email to [email protected] * To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano?hl=en
