Add two more database sync functions to WP-Stack/Capistrano 2 functions.

55 views
Skip to first unread message

Daniel Shepherd

unread,
Feb 5, 2014, 2:34:25 PM2/5/14
to capis...@googlegroups.com
Versions:
  • Ruby - ruby 2.0.0p247
  • Capistrano (2.15.5)
  • Rake / Rails / etc (4.0.2)
Platform:
  • Working on.... Mac OSX Mavericks. Local dev on Mac Mini, SSHing into it from Macbook or iMac with -A so all keys are passed through, also testing direct on Mac Mini too.
  • Deploying to... EC2 instance, animoto runing Centos 6.5, nginx, php-fpm. Its running the same versions.
Files:

Ok so I'm using WP-Stack with Capistrano 2, most of the settings above are default. However as default it only recognises "production" and "staging" roles. I'm happy to deploy only to production and staging so everything in that regard words just fine. Development and Local will be running a git checkout. However I currently have the option to "Cap staging db:sync" and it'll take the production database and pull it into the staging database. Id love it if someone could tell me how to add (or do it for me in paste ideally!) the ability to do "Cap dev db:sync" and "Cap local db:sync" and pull in the production database to those two DB tables too?

Id played around a bit and I've added into the cap file the "dev" and "local" roles, which i think is right. In the deploy.rb file I've added the extra two sections for the dev and local db credentials. Id successfully edited the tasks.rb file to use "local" instead of "staging" and managed to pull in the production database just fine. So I think i know that its just a case of editing the terms staging in there, but I can't for the life of me copy and paste that task two more times in the tasks.rb giving me the option to run the two additional options I want, I keep getting syntax errors and i;m not really sure what I need to do to replicate that two more times to achieve what I need. I guess this is very easy for someone who know what they're doing in Capistrano!

So a big thanks in advance.

Daniel Shepherd

unread,
Feb 8, 2014, 6:29:10 AM2/8/14
to capis...@googlegroups.com
Anyone?
Reply all
Reply to author
Forward
0 new messages