Capistrano is an awesome tool to have in your toolbox. It was originally developed to simplify and automate the deployment of Rails web applications. Featuring built in support for typical deployment scenarios, it is also flexible enough to allow you to completely override certain behaviors. That being the case, it can be used to deploy non-Rails web application like those built on the Drupal and WordPress CMS platforms.
Getting Started
In order to use Capistrano, you must first install ruby and the ruby gem system. Now we can install the Capistrano gem along with the Rails-less-deploy gem which will allow use to remove all of the built-in Rails-specific behavior.
Now that Capistrano is installed on your system, we can prepare the application to use it.
Basic Configuration
You will notice that a few files have been created in your application directory.
. Capfile config/ - deploy.rb
Let’s update the Capfile to pull in the Rails-less-deploy magic. This gem is responsible for overriding all of the Rails-specific tasks so that we can implement our own custom behavior.
Now, just like any normal Capistrano setup, we must configure some basic details about our destination infrastructure.
WordPress Example
Taking a typical WordPress install as an example, there a few custom tasks that we can write to make our lives easier. First, let’s extend the default setup task to include tasks for dropping our default configuration file and creating a uploads folder in the shared directory.
Now, log into your server and update your app/shared/config/wp-config.php file to match the server configuration. When that is done, you are ready to the deploy the application code. We will augment that process with a few tasks that will sync our uploads directory as well as symlink our shared config file to the current release.
About us and this blog
We are a full-service digital marketing agency that connects companies with customers, click by click.
Request a free quote
We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.
Subscribe to our newsletter!
Recent Posts
- Top 25+ SEO Mistakes To Rectify Now (Infographic) October 9, 2018
- User-Generated Content Boosts Brands August 2, 2018
- Website Relaunch: Common SEO Mistakes October 19, 2016