A civic-minded citizen seeking the singularity

An entry

Moving a Heroku App to Pivotal Cloud Foundry

Date: 2016-01-22
Status: draft
Tags: ruby devops deployment


Recently, I've moved many applications from Dreamhost to Heroku, and it has been great to alleviate some of the deployment workarounds I had to do on Dreamhost that disappeared with Heroku. However, what did appear was an increasingly large monthly bill for web services. Quickly peaking $100/month for personal and side apps; I traded one convenience for another.

More recently, I've heard about Pivotal's Cloud Foundry or Pivotal Web Services, and wanted to give it a try.

Moving a Rails app from Heroku to PWS took a little getting used to. But once going through a time or two, it felt just as easy, and felt a bit more performant for my starter app.

My Experience

Logging into PWS the first time; the web UI has a modern, enterprisey feel. Dropped onto the Welcome screen, I'm instructed to download and install the command-line tool (CLI). Clicking through to "Getting Started..." reiterates the first steps and ends with a link on how to get started deploying your first app (which was a little awkward, but...). Clickety click.


Create an "environment" inside Pivotal Web Services. An environment consists of Organizations Org; the highest level. Orgs have 1 or more Spaces. Spaces Space, are subdivisions. Maybe like departments. Spaces have one or more Applications App.

When it came time to deploy, I had a bit of trouble finding out how to get an app deployed. Fortunately, it was easy once I figured it out (the cost is finding information). To deploy a Rails app to Pivotal Web Services, use cf push.

cf push pushes the whole current directory (NOT a branch, like Heroku does)

So beware of tmp files, logs, uploads, and other things you may have accumulated in a local development branch.



Provision and Bind a Service (like Postgres)

My Rails app on Pivotal Web Services uses a manifest.yml configuration file, which is new to me, coming from Heroku.