Total Pageviews

Tuesday, 4 October 2016


Deployinator - Deploy code like Etsy
Deployinator is a deployment framework extracted from Etsy. We've been using it since late 2009 / early 2010. This has been revamped into a ruby gem.

Deployments are grouped by "stacks". You might have a "web" and "search" stack.
Each of those stacks might have different deployment environments, such as "staging" or "production".
You can map a button to each of these environments, to create multi-stage pushes within each stack.

This demo assumes you are using bundler to install deployinator. If you aren't you can skip the bundler steps.
  • Create a directory for your project to hold your specific code (outside of the gem and this will be your own internal repository). mkdir test_stacks
  • Create a Gemfile for bundler:
    source ''
    gem 'etsy-deployinator', :git => '', :branch => 'master', :require => 'deployinator'
  • Install all required gems with bundler:
    $ bundle install --path vendor/bundle
  • Run the following command to make deployinator gem's rake tasks available to you:
    $ shopt -s xpg_echo
    $ echo "require 'deployinator'\nload 'deployinator/tasks/initialize.rake' " > Rakefile
  • Create a binstub for the deploy log tailing backend:
    bundle binstub etsy-deployinator
  • Initialize the project directory by running the following command replacing Company with the name of your company/organization. This must start with a capital letter.
    $ bundle exec rake 'deployinator:init[Company]'
  • Run the tailer as a background service (using whatever init flavor you like)
    ./bin/deployinator-tailer.rb &


Example Stack
  • Use the deployinator rake task to create the stub for your stack. Replace test_stack with the name of your stack. This should be all lowercase with underscores but if you forget the rake task will convert from camelcase for you. The commands run by the rake tasks are logged to stderr.
    $ bundle exec rake 'deployinator:new_stack[test_stack]'
  • We need a server to run our Sinatra application. For the purpose of this demo, we will use puma. Let's install puma into our bundle. Add the following to your Gemfile:
    gem 'puma'
  • Now update your bundler:
    bundle install --path vendor/bundle --no-deployment && bundle install --path vendor/bundle --deployment
  • Start the server by running:
    • The host could be localhost or the dns name (or ip address of the server you are using). You can set any port you want that's not in use using the -p flag.
    $ bundle exec puma -b tcp://

  • You will probably want a robust server like apache to handle production traffic.
  • The config/base.rb file is the base config for the application. Replace all occurences of test_stack with the name you chose above.