[wp-hackers] Deployment process (was Exporting Menus)

Tom Adams tom at thedextrousweb.com
Wed Sep 1 14:41:00 UTC 2010


> Sorry for harping on this.. I just want to make sure I understand.. so each site has a lib/config.yml right above it's document root, and you can then just do the cap foo magic?

I think your deployment setup is very different to mine so perhaps I should
explain a bit more clearly (I'll ignore submodules completely, because it makes
no difference to wp-capistrano if you have submodules or not).

So where I think you have a centralised capistrano directory where you can run
"cap a_client_site deploy", we go into our check-out of development code and
then run capistrano from there (cd /var/vhosts/docs/a_client_site/wp-content && cap
deploy).

That's an interesting way of doing things, but wp-capistrano doesn't work like
that. So I'll explain how it works for wp-capistrano:

On your _development_ machine, you have:

/var/vhosts/docs/a_client_website

That's the document root, where wp-config.php lives, and such.

Inside there you have:

/var/vhosts/docs/a_client_website/wp-content

As you do in any WordPress installation. This is your main git repository!
Imagine that's pushed to git at github.com:user/a_client_website

Then you also have:

/var/vhosts/docs/a_client_website/wp-content/lib/config.yml

Which contains the following:

--- 
application:
  repository: git at github.com:user/a_client_website
wordpress:
  repository: git://github.com/dxw/wordpress.git
  version: v3.0.1
deploy:
  production:
    ssh_user: deploy
    ssh_domain: a-client-website.com
    modules:
      - wp-super-cache
      - shared-dirs:
        - uploads
    path: /var/vhosts/a-client-website.com/capistrano_dir
    vhost: a-client-website.com
    database:
      user: root
      name: a_client_website

Then:
$ cd /var/vhosts/docs/a_client_website/wp-content
$ cap setup

That will set capistrano up on the remote machine (make sure
deploy at a-client-website.com has write access to
/var/vhosts/a-client-website.com/capistrano_dir). Then all you need to do
is run "cap deploy", and you should find a fully working copy of WordPress at:

/var/vhosts/a-client-website.com/capistrano_dir/current/finalized

And inside there will be your wp-content checked out.

Hopefully that's enough detail to get you started with wp-capistrano, but feel
free to ask if there's anything else.
-- 
Tom Adams
Developer, The Dextrous Web
Web: http://thedextrousweb.com/
Twitter: @holizz, @dextrousweb


More information about the wp-hackers mailing list