Home of Greg Bergé. Let's speak about JavaScript.

Forget Capistrano and deploy your node.js application using Shipit

Why Shipit?

When I worked at Le Monde, our need was simple: deploy an application on multiple servers. For our PHP backend we used a self-made tool written in PHP to deploy them, but it had some flaws (no atomic deployment, no rollback, centralized configuration).

For our fresh new node project I wanted to use a solid tool. I had heard of Capistrano to deploy everything an anything, so I started to use it. Capistrano is probably a great tool if you code in ruby, but if you don't know ruby at all, this is horrible! I persist to use it and when I tried to upgrade to the version 3 that has no documentation I abandoned and decided to code my own deployment tool in node.js. Shipit was born!

Shipit was built to be a Capistrano alternative for people who want to write tasks in JavaScript and don't have a piece of ruby in their beautiful codebase.

Grunt power

First I wanted to do a project from scratch but then I realised that deploying is just running some tasks in a specified order. And for that in node, there is Grunt, it's the standard (or it was).

So in fact Shipit is just a grunt extension with some predefined tasks.

Your first deployment

I will try to explain how to set up your first deployment using shipit. For that, we will just deploy an "hello world" app. You will be able to follow the steps along commits in this tutorial repository.

1. Set up the hello world project

The first thing to do is to set up an hello world project, it can be any project written in any language but for this tutorial we will just write a project that echo "hello world".

You have probably noticed that the server has started, it's because the task "deploy:publish" is used in the rollback too.

Conclusion

Congratulation, your are now a Shipit master!

Shipit is ready for production, we use it for 1 year at Le Monde at we never had a problem with it.

I hope that this tutorial will help you to deploy some projects. You can find the documentation of Shipit in the readme of the repository. I will be happy to accept your pull-requests if you want to contribute to it.