Skip to content

Instantly share code, notes, and snippets.

@jamesward
Created May 1, 2012 13:31
Show Gist options
  • Save jamesward/2567916 to your computer and use it in GitHub Desktop.
Save jamesward/2567916 to your computer and use it in GitHub Desktop.
dosug

Heroku @ Denver Open Source Users Group


About James Ward

Desktop Linux user since: Slackware 1.0 (which came on 24 3½" floppies)

Java Developer since: 1997

First Programming Language: Pascal

Favorite Programming Language: x86 Assembler

Agenda

  1. Heroku Quick Start with Play Framework
  2. Heroku Basics
  3. Heroku Add-ons
  4. Heroku for Java
  5. Heroku for Scala
  6. Heroku for Ruby
  7. Heroku for Node.js
  8. Heroku for Python
  9. Heroku for Anything

Heroku Quick Start with Play Framework

$ play new foo
$ cd foo
$ git init
$ git add conf app public
$ git commit -m init
$ heroku create -s cedar
$ git push heroku master

Heroku Basics

Deployment

  1. Copy git repo to Heroku:

     git push heroku master
    
  2. Heroku compiles code

  3. Heroku creates a "slug" file

  4. Heroku deploys "slug" onto a "dyno"

  5. Heroku starts the process

Terminology

http://heroku.com/how

User has 0 or more Applications

Application has 1 git repository

Application has 0 or more Processes

Process is defined in a Procfile

Process named "web" can listen on one port for HTTP

Process runs on 0 or more Dynos

Dynos are isolated (LXC) and managed execution environments

Application has 0 more more external resources - Heroku Add-ons

Buildpack receives a git push and produces a "slug"

Slug contains the non-system dependencies for all Processes

Dynos are ephemeral and stateless

HTTP(s) requests are randomly routed to the "web" Dynos

Pricing

http://www.heroku.com/pricing

$0.05 / dyno hour

750 free dyno hours per application per month

The Heroku CLI

http://toolbelt.heroku.com

$ heroku help

Heroku Add-ons

Add-ons are third party cloud services for things like caching, databases, monitoring, management, etc

http://addons.heroku.com

Heroku for Java

Maven, Play, and Grails

http://heroku.com/java

http://www.youtube.com/watch?v=mkmWwA0EoGg

https://devcenter.heroku.com/articles/java

https://github.com/jamesward/play2bars

https://github.com/jamesward/hello-java-webapp_runner

https://github.com/jamesward/jaxrsbars

https://github.com/jamesward/grailbars

Heroku for Scala

Play and SBT

https://devcenter.heroku.com/articles/scala

https://github.com/jamesward/hello-scala-finagle

https://github.com/jamesward/play2bars

Heroku for Ruby

Ruby & Rails

https://devcenter.heroku.com/articles/ruby

https://github.com/jamesward/hello-ruby-sinatra

Heroku for Node.js

Node.js

https://devcenter.heroku.com/articles/nodejs

https://github.com/jamesward/hello-node_js-express

Heroku for Python

Python

https://devcenter.heroku.com/articles/python

https://github.com/jamesward/hello-python-flask

https://github.com/jamesward/flaskbars

Heroku for Anything

Buildpacks are open and forkable

https://github.com/heroku

Specify on Create

$ heroku create -s cedar --buildpack https://github.com/jamesward/heroku-buildpack-java.git

Change the buildpack

$ heroku config:add BUILDPACK_URL=https://github.com/jamesward/heroku-buildpack-java.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment