Automated Wordpress deployment with Capistrano
git clone https://raw.github.com/DamianCaruso/wordpresstano
cd wordpresstano
bundle install
You need a private Git repository containing this project.
Next, update config/deploy.rb
and config/deploy/<environment.rb>
accordingly.
Create the following structure under the <deploy_to>
directory in each environment.
.
+-- shared
| +--config
| | +-- database.php
| | +-- secrets.php
You can use the sample files as templates.
Install Composer.
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer`
Apache/Nginx and mod_php/php-fpm setup are out of scope and will not be dealt in this document.
bundle exec cap production deploy
Visit http://<yourwordpressdomain>/wp/wp-admin/
and follow the instructions in the installation wizard.
Composer is used as dependency manager. Wpackagist as repository for wordpress themes and plugins.
- Edit
composer.json
to upgrade or install plugins, themes or the wordpress core itself. - Run
composer update
to update locally. - Commit and push the updated json and lock file to your repo.
- Run
bundle exec cap production deploy
to deploy your changes. - Go to your site, login and perform any pending database updates.