30 more seconds, running in Cloud Foundry v2
It’s now been a little over six months since I did my last up and running with Cloud Foundry post and now that things have moved to CFv2 it looks like I need to do an update. Pivotal has rolled out an enterprise CF that runs on VSphere and I’ve got it up and running in my lab ( cf.simpit.com … you’ll have to get your own ) which made me realize I need to update my post on getting an app up and running quickly. So here it is:
scottkahler$ gem install cf scottkahler$ gem install sinatra
scottkahler$ mkdir demo scottkahler$ cd demo/ scottkahler$ vim demo.rb
require ‘sinatra’
get ‘/’ do
“Hello from the Demo”
end
scottkahler$ vim config.ru
require ‘./demo’
run Sinatra::Application
scottkahler$ vim Gemfile
source ‘https://rubygems.org’
gem ‘sinatra’
ruby ‘2.0.0’
scottkahler$ bundle Fetching gem metadata from https://rubygems.org/........... Fetching gem metadata from https://rubygems.org/.. Resolving dependencies... Using rack (1.5.2) Using rack-protection (1.5.1) Using tilt (1.4.1) Using sinatra (1.4.4) Using bundler (1.3.5) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. scottkahler$ cf target api.cf.simpit.com Setting target to https://api.cf.simpit.com... OK Target Information (where will apps be pushed): CF instance: https://api.cf.simpit.com (API version: 2) user: admin target app space: development (org: demo) scottkahler$ scottkahler$ cf push Name> demo Instances> 1 1: 128M 2: 256M 3: 512M 4: 1G Memory Limit> 256M Creating demo... OK 1: demo 2: none Subdomain> demo 1: cf.simpit.com 2: none Domain> cf.simpit.com Binding demo.cf.simpit.com to demo... OK Create services for application?> n Save configuration?> y Saving to manifest.yml... OK Uploading demo... OK Preparing to start demo... OK -----> Downloaded app package (4.0K) -----> Using Ruby version: ruby-2.0.0 -----> Installing dependencies using Bundler version 1.3.2 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment Fetching gem metadata from https://rubygems.org/.......... Fetching gem metadata from https://rubygems.org/.. Installing rack (1.5.2) Installing rack-protection (1.5.1) Installing tilt (1.4.1) Installing sinatra (1.4.4) Using bundler (1.3.2) Your bundle is complete! It was installed into ./vendor/bundle Cleaning up the bundler cache. -----> Downloaded app package (4.0K) -----> Using Ruby version: ruby-2.0.0 -----> Installing dependencies using Bundler version 1.3.2 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment Fetching gem metadata from https://rubygems.org/.......... Fetching gem metadata from https://rubygems.org/.. Installing rack (1.5.2) Installing rack-protection (1.5.1) Installing tilt (1.4.1) Installing sinatra (1.4.4) Using bundler (1.3.2) Your bundle is complete! It was installed into ./vendor/bundle Cleaning up the bundler cache. -----> Uploading droplet (50M) Checking status of app 'demo'... 1 of 1 instances running (1 running) Push successful! App 'demo' available at demo.cf.simpit.com scottkahler$
And BAM! Once again I’ve got a running app.