Capistrano

Deploying a third-party Rails application - like Gitlab

We all know how to deploy our own Rails projects. (If not, read this guide.) But how do you handle deploying a third-party application that may require some customisation on your part? A good example would be Gitlab Gitlab is an open source Github clone, build using Ruby on Rails. It’s a nice project that uses Gitosis under the hood to manage your git repositories. There are several good installation guides available on the web, but they all assume you want to deploy gitlab verbatim - without any modification or configuration

Capistrano and the custom maintenance page

Randuin posted a comment on my previous Lighting fast, zero-downtime deployments with git, capistrano, nginx and Unicorn post asking how I handle database migrations. This is a good question. Database migrations, especially with large datasets, take a long time to run. They also lock your database tables which may cause all kinds of trouble. There’s a quite an easy solution for this, offered to us by Capistrano. Unfortunately it will cause downtime for your site while the migration is running.

Lighting fast, zero-downtime deployments with git, capistrano, nginx and Unicorn

Everyone who has ever developed a web app has had to deploy it. Back in the day you simply uploaded your files with FTP and everything would be good. Today we have to clone git repositories, restart servers, set permissions, create symlinks to our configuration files, clean out caches and what not. Doctor, what’s wrong? In my opinion there are two critical problems with deployments today: They are slow They cause downtime Both topics have been discussed by the likes of Twitter and Github.

Show the current SVN revision in your Rails app

I’m current developing a Rails application. I deploy this application to a demonstration server using capistrano. To streamline feedback and bug reporting I want to show the current revision number of the code that’s published on the demo server to show in the footer of every page. First I looked into Subversion keyword expansion, but this is marked as ‘evil’ and it doesn’t meet my requirements. I want to show the latest revision number of the entire repository and not just that of the current file. Luckily for me, I use capistrano. Here’s how I fixed the problem.