Easy deployment for Wordpress sites including your database.
- Your production and staging servers have to be accessible via ssh
- Git has to be installed in every environment
- The same applies to wp-cli (http://wp-cli.org/#install)
For the capistrano deployment to run properly you have make some preparations to your local environment:
- Get the latest wordpress version with
git submodule init
andgit submodule update
- capistrano must be installed:
bundler install
- Rename local-config.SAMPLE.php to local-config.php and replace the placeholders with your database credentials
- Rename config.SAMPLE.rb to config.rb (located in the config directory). For every stage you have to edit your database credentials. Pay attention to the :local_url variable!
- Rename the files in config/deploy accordingly and edit the variables so they match the environment
- Activate the WP Migrate DB and WP Migrate DB CLI plugin
Deploy your current code base to the staging server
Copy the staging database to your local database.
Copy the local database to the staging server
The tasks wordpress:db:pull
and wordpress:db:push
will find the remote url and replaces it with your local url. So keeping your database in sync is a no brainer.
- Wordpress Multisite Deployment
- Keeping upload folders in sync
Wordpress as a submoduleit's ugly, but it gets the job done ...