Skip to content

Instantly share code, notes, and snippets.

@martinos
Created February 21, 2010 20:43
Show Gist options
  • Save martinos/310526 to your computer and use it in GitHub Desktop.
Save martinos/310526 to your computer and use it in GitHub Desktop.
source_url=source_url.com
app_name=app_name
# We download the full webside content
wget --mirror -r $source_url
# We move the web content into the rack public folder
mkdir -p $app_name/public
mv $source_url/* $app_name/public
rm -rf $source_url
cd $app_name1
# We create the rack config file to serve the static web site contained in the public directory
cat >> config.ru << "EOF"
require 'masquerade'
run Sinatra::Application
EOF
cat >> masquerade.rb << "EOF"
require 'rubygems'
require 'sinatra'
set :public, Proc.new { "public" }
# This before filter ensures that your pages are only ever served
# once (per deploy) by Sinatra, and then by Varnish after that
before do
response.headers['Cache-Control'] = 'public, max-age=31557600' # 1 year
end
get '/' do
File.read('public/index.html')
end
EOF
# We create git repository
git init
git add .
git commit -m "Initial comit"
heroku create $app_name
git push heroku master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment