Using Subversion to deploy WordPress

Well, nothing prevents from using Subversion for solving this tasks

Note: some steps may differ depending on layout of your own repository for themes/plugins (I suppose, they are dirs inside trunk, and the whole tree doesn’t repeat standard WP-layout: /wp-content/themes/ wp-content/plugins/)

In order to start you have to have:

  • Empty Subversion repository, in which you can commit
  • Basic knowledges about svn:externals
  • URLs of all components (including WP-core), which you want to combine in “distribution”

Common rule:

All components are served in own repos, our repo only links they together in single place

Actions:

  • Checkout (empty) trunk svn co URL/trunk Deploy
  • Write all components definitions in text file (externals.txt for sample) (save it in any place, it haven’t to be a part of repo), it they appear in file something like

wordpress http://core.svn.wordpress.org/tags/3.5/

wordpress/wp-content/plugins/plugin-one URL-OF-PLUGINONE

...

wordpress/wp-content/themes/Mytheme URL-OF-MYTHEME

(each line is new externals definition, 1-st part – relative path to local dir, space(s)-separated 2-nd part – source of directory content)

  • cd Deploy
  • Use externals.txt for defining all externals in trunk’s root at once svn propset svn:externals . -F ../externals.txt
  • Commit changes
  • Update (or checkout trunk into new dir) and see all: core, needed modules and themes collected inside wordpress dir

Next time, when you’ll want to change configuration of deployable WP you have only edit existing svn:externals definitions (‘svn propedit’, ‘svn commit’) and get after checkout updated configuration.