Book Image

Heroku Cookbook

By : Mike Coutermarsh
Book Image

Heroku Cookbook

By: Mike Coutermarsh

Overview of this book

Heroku is a Platform as a Service that enables developers to rapidly deploy and scale their web applications. Heroku is designed for developer happiness, freeing developers from doing system administrative tasks such as configuring servers and setting up load balancers. Developers are able to focus on what they do best, building web applications, while leaving the details of deployment and scaling to the experts at Heroku. This practical guide is packed with step-by-step solutions to problems faced by every production-level web application hosted on Heroku. You'll quickly get comfortable with managing your Heroku applications from the command line and then learn everything you need to know to deploy and administer production-level web applications.
Table of Contents (17 chapters)
Heroku Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating new Heroku applications


When starting a new Heroku application, it's pretty common that we'll find ourselves repeating the same steps. There is probably a set of add-ons that we find ourselves using over and over again. For a Rails app, we might find ourselves consistently setting up a stack with Postgres, MemCachier, LogEntries, and Rollbar. We can automate this!

In this recipe, you'll learn how to create applications and enable add-ons programmatically via the API.

Note

Be sure to read the Getting started with the Platform API Gem recipe before attempting this recipe.

How to do it…

Let's start by opening up a terminal and going to our heroku-api-examples directory. Then, we can perform the following steps:

  1. We'll use Ruby in this recipe. Let's start it now by running console.rb:

    $ ruby console.rb
    
  2. To create a new application, we can use app.create. We'll need to specify the application's name, its region (us or eu), and its Heroku stack. We should always use the latest stack, which at...