deployment patterns in the ruby on rails world

26
DEPLOYMENT PATTERNS IN THE RUBY on RAILS WORLD DEVOPSDAYS INDIA 2011

Upload: nikhil-mungel

Post on 18-Dec-2014

7.594 views

Category:

Technology


0 download

DESCRIPTION

Nikhil Mungel and Ajey Gore from ThoughtWorks presented this at DevOpsDays Bangalore 2011.

TRANSCRIPT

Page 1: Deployment Patterns in the Ruby on Rails World

DEPLOYMENT PATTERNS

IN THE RUBY on RAILS WORLD

DEVOPSDAYS INDIA2 0 1 1

Page 2: Deployment Patterns in the Ruby on Rails World

Nikhil Mungel

@hyfather

Ajey Gore@AjeyGore

Page 3: Deployment Patterns in the Ruby on Rails World

ApacheApache

Apache

Passenger

ApacheRails

Page 4: Deployment Patterns in the Ruby on Rails World

/app/config/db/doc/lib/log/public/script/test/tmp/vendorconfig.ruREADMERakefile

* Ruby on Rails

Page 5: Deployment Patterns in the Ruby on Rails World

Local Repository

AppServer Pull Git

signal over SSH

run updated script

1

23Pull

AppServer

contains all scripts

Page 6: Deployment Patterns in the Ruby on Rails World

SCM-awaredeployments

fast and effortless

dev and deployment on ruby

transfers only delta

dev env mess can overflow

compiling native gemsadmin-hell for IT/Ops

Page 7: Deployment Patterns in the Ruby on Rails World

GitCI

RunsTests

Tests

CodePull

QA

$ deploy 77ef185d7

$ deploy 77ef185d7

Staging Prod.

Page 8: Deployment Patterns in the Ruby on Rails World

GitCI

RunsTests

Tests

CodePull

QA Staging

Production

$ deploy 77ef185d7

$ deploy 77ef185d7

Page 9: Deployment Patterns in the Ruby on Rails World

CI

RunsTests

Page 10: Deployment Patterns in the Ruby on Rails World

UnitTests

FunctionalTests

PerfTests

CI

Git Pull

Page 11: Deployment Patterns in the Ruby on Rails World

UnitTests

FunctionalTests

PerfTests

CI

Git Pull

Push a Tag

tag: mainline-234

Page 12: Deployment Patterns in the Ruby on Rails World

UnitTests

FunctionalTests

PerfTests

CI

Git Pull

Page 13: Deployment Patterns in the Ruby on Rails World

CIGit

mainline unittests

functests

perftests

Page 14: Deployment Patterns in the Ruby on Rails World

mainline unittests

functests

perftests

deploy package emit consume

on remotemachine

Gittag

on CImachine

12

3

Page 15: Deployment Patterns in the Ruby on Rails World

mainline unittests

functests

perftests

deploy emit consume

on remotemachine

Gittag1

2

3on CImachine

package

RPM

rubygem

tarball

war

deb

Page 16: Deployment Patterns in the Ruby on Rails World

tarball

better than a directory

extremely simple to setup

no metadata

Page 17: Deployment Patterns in the Ruby on Rails World

RPM, debstored in a repository

standard locations -- /etc

first-class system service

effected by chef/puppet

toolchain expertise

less common

maintain a repository

Page 18: Deployment Patterns in the Ruby on Rails World

rubygem

maintain a gem repository

tarball with metadata

effected by chef/puppet

stored in a repository

Page 19: Deployment Patterns in the Ruby on Rails World

mainline unittests

functests

perftests

deploy consume

on remotemachine

Gittag1

2

3on CImachine

package emit

upload to a repo

expose overCI artifact API

Page 20: Deployment Patterns in the Ruby on Rails World

mainline unittests

functests

perftests

deploy

Gittag1

2

3on CImachine

emitpackage consume

on remotemachine

Page 21: Deployment Patterns in the Ruby on Rails World

gem install

yum install

apt-get install

Config Management

Page 22: Deployment Patterns in the Ruby on Rails World

my.cnf

ssh_config

httpd.conf

/etc

Page 23: Deployment Patterns in the Ruby on Rails World

database.yml

.htaccess

private keys for external systems

/etc

Page 24: Deployment Patterns in the Ruby on Rails World

First ClassLinux Application Software

/etc/myapp

Page 25: Deployment Patterns in the Ruby on Rails World

bundle install --without test development

bundle package

bundle install --deployment

install to vendor/bundle

.gem files to vendor/cache

bundle install --local

Page 26: Deployment Patterns in the Ruby on Rails World

Thanks!@hyfather @AjeyGore