Skip to content

Instantly share code, notes, and snippets.

@mrchrisadams
Created January 20, 2013 00:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrchrisadams/4575934 to your computer and use it in GitHub Desktop.
Save mrchrisadams/4575934 to your computer and use it in GitHub Desktop.
This is a companion gist for an issue I raised on the cloudfoundry-vagrant repo, created by @andreacampi.
---
applications:
.:
name: env
framework:
name: sinatra
info:
mem: 128M
description: Sinatra Application
exec: ruby env.rb
url: ${name}.${target-base}
mem: 128M
instances: 1
# taken from
# https://github.com/cloudfoundry/oss-docs/tree/master/vcap/single_and_multi_node_deployments_with_dev_setup#trying-your-setup
require 'rubygems'
require 'sinatra'
require 'json/pure'
get '/' do
host = ENV['VMC_APP_HOST']
port = ENV['VMC_APP_PORT']
"<h1>XXXXX Hello from the Cloud! via: #{host}:#{port}</h1>"
end
get '/env' do
res = "<html><body style=\"margin:0px auto; width:80%; font-family:monospace\">"
res << "<head><title>CloudFoundry Environment</title></head>"
res << "<h3>CloudFoundry Environment</h3>"
res << "<div><table>"
ENV.keys.sort.each do |key|
value = begin
"<pre>" + JSON.pretty_generate(JSON.parse(ENV[key])) + "</pre>"
rescue
ENV[key]
end
res << "<tr><td><strong>#{key}</strong></td><td>#{value}</tr>"
end
res << "</table></div></body></html>"
end
rails new trying_vagrant_cloudfoundry
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/application.html.erb
create app/mailers/.gitkeep
create app/models/.gitkeep
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/initializers/wrap_parameters.rb
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create doc
create doc/README_FOR_APP
create lib
create lib/tasks
create lib/tasks/.gitkeep
create lib/assets
create lib/assets/.gitkeep
create log
create log/.gitkeep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/index.html
create public/robots.txt
create script
create script/rails
create test/fixtures
create test/fixtures/.gitkeep
create test/functional
create test/functional/.gitkeep
create test/integration
create test/integration/.gitkeep
create test/unit
create test/unit/.gitkeep
create test/performance/browsing_test.rb
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.gitkeep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.gitkeep
create vendor/plugins
create vendor/plugins/.gitkeep
run bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Installing rake (10.0.3)
Installing i18n (0.6.1)
Installing multi_json (1.5.0)
Using activesupport (3.2.7)
Installing builder (3.0.4)
Using activemodel (3.2.7)
Using erubis (2.7.0)
Using journey (1.0.4)
Installing rack (1.4.4)
Using rack-cache (1.2)
Installing rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.7)
Using mime-types (1.19)
Using polyglot (0.3.3)
Installing treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.7)
Using arel (3.0.2)
Installing tzinfo (0.3.35)
Using activerecord (3.2.7)
Using activeresource (3.2.7)
Using bundler (1.1.4)
Installing coffee-script-source (1.4.0)
Installing execjs (1.4.0)
Installing coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Installing json (1.7.6) with native extensions
Using rdoc (3.12)
Installing thor (0.16.0)
Using railties (3.2.7)
Installing coffee-rails (3.2.2)
Installing jquery-rails (2.2.0)
Using rails (3.2.7)
Installing sass (3.2.5)
Installing sass-rails (3.2.6)
Installing sqlite3 (1.3.7) with native extensions
Installing uglifier (1.3.0)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
rails new trying_vagrant_cloudfoundry
vmc push
Would you like to deploy from the current directory? [Yn]:
Application Name: trying_vagrant_cloudfoundry
Detected a Rails Application, is this correct? [Yn]: y
Application Deployed URL [trying_vagrant_cloudfoundry.vcap.me:9022]:
Memory reservation (128M, 256M, 512M, 1G, 2G) [256M]:
How many instances? [1]:
Create services to bind to 'trying_vagrant_cloudfoundry'? [yN]: n
Would you like to save this configuration? [yN]: y
Manifest written to manifest.yml.
---
applications:
.:
name: trying_vagrant_cloudfoundry
framework:
name: rails3
info:
mem: 256M
description: Rails Application
exec:
url: ${name}.${target-base}
mem: 256M
instances: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment