Skip to content

Instantly share code, notes, and snippets.

@jamesward
Created June 14, 2012 14:57
Show Gist options
  • Save jamesward/2930850 to your computer and use it in GitHub Desktop.
Save jamesward/2930850 to your computer and use it in GitHub Desktop.
Uber Heroku Workshop

Running Java, Play! & Scala Apps on the Cloud Workshop

Goals

  • Deploy a Spring + Tomcat Java app. Make changes and redeploy.
  • Heroku Basics: Logging, Scaling, Configuring, Collaborating, Extending
  • Deploy Play Framework on Heroku

Prerequisites

Java on Heroku

  1. Go to: java.heroku.com
  2. Clone the Spring + Tomcat app
  3. Test out the new app
  4. Follow the instructions on the app's index page to copy the app to your local machine
  5. Make a change
  6. Test the change locally
  7. Push the change

Heroku Basics

  • Logging

      heroku logs -t
    
  • Scaling

      heroku scale web=2
    
  • Configuring

      heroku config:add FOO=bar
      heroku config
    
  • Collaborating

      heroku sharing:add jw+demo@heroku.com
    
  • Extending with Heroku Add-ons

      heroku addons:add papertrail
    

Play on Heroku

  1. Create a new Play app:

     play new foo
    
  2. Test the app locally:

     cd foo
     play ~run
    

    Open: http://localhost:9000

  3. Change the app/views/index.scala.html file

  4. Test the change locally

  5. Create a new git repo, add the files, commit:

     git init
     git add .
     git commit -m init
    
  6. Create a new app on Heroku:

     heroku create -s cedar
    
  7. Deploy the app:

     git push heroku master
    
  8. Test the app on Heroku:

     heroku open
    

Learn More

Heroku Dev Center

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment