Heroku deployment
     by Stoyan Zhekov
BULGARIA


 Bulgaria
http://en.wikipedia.org/wiki/
     Music_of_Bulgaria
Deploy ?
Deploy !

  “Install the
software into an
  operational
 environment”
Deploy




• Where?
Deploy



• Where?
• Packaging
Deploy



• Where?
• Packaging
• Updates
Deploy


•   Where?
•   Packaging
•   Updates
•   Scale
Where?



Local
Where?



Local
   vs
Remote
Packaging


  RVM GEMSET

        +
BUNDLER ( Gemle )
Packaging


rvm --create 1.9.2@myapp

           +
gem install bundler --pre
Updates




• Save old version
Updates



• Save old version
• Upload new version
Updates



• Save old version
• Upload new version
• Restart app server
Let’s do it!




web visitors counter
Local deployment


•   Where?      localhost
•   Packaging   .rvmrc + Gemfile
•   Updates     git flow
•   Scale       ?
Local deployment



 brew install   git-flow
gem install bundler   --pre
curl get.pow.cx | sh
Local deployment


•   Where?    localhost
•   Packaging .rvmrc + Gemfile
•   Updates   git
•   Scale      ?
Scale


gem install  foreman
foreman start -c web=4
Local deployment


•   Where?      localhost
•   Packaging   .rvmrc + Gemfile
•   Updates     git
•   Scale       foreman
Remote deployment


•   Where?      WHY? HOW?
•   Packaging   .rvmrc + Gemfile
•   Updates     git
•   Scale       foreman
Remote deployment


•   Where?      VPS? Capistrano?
•   Packaging   .rvmrc + Gemfile
•   Updates     git
•   Scale       thin , ...
Too complicated
Remote deployment


•   Where?      VPS? Capistrano?
•   Packaging   .rvmrc + Gemfile
•   Updates     git
•   Scale       thin , ...
Remote deployment



gem install   heroku
http://heroku.com/
http://devcenter.heroku.com/
Heroku


• Amazon EC2 ( SCALE )
• PaaS        ( EASY )
• Pay per use ( FREE )
PaaS
Dynos
Dynos



“Forget servers, instances, and
VMs. Focus on processes.”
Dynos


“A dyno is a single process
  of any type running on the
      Heroku platform.”
Stacks
heroku create --stack cedar
Add0ns
http://addons.heroku.com/
heroku addons:add mongohq:free
Remote deployment


•   Where?      Heroku
•   Packaging   .rvmrc + Gemfile
•   Updates     git
•   Scale       ?
Scale $0.05/hour




http://www.heroku.com/pricing#0-0
Scale $0.05/hour




http://www.heroku.com/pricing#0-0
Scale $0.05/hour




http://www.heroku.com/pricing#0-0
Scale $0.05/hour




http://www.heroku.com/pricing#0-0
Scale for   free?
Scale


gem install   unicorn
http://MOGOK.jp/
MOGOK by IIJ



gem install   mogok
Thank you!

Deployment on Heroku