public
Last active

Rake tasks for easier Facebook development.

  • Download Gist
deploy.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#
# Taken from http://www.appelsiini.net/2010/rake-tasks-for-facebook
#
set :application, "foo-bar"
set :repository, "git@github.com:username/#{application}.git"
set :user, "sinatra"
set :server, "#{application}.example.com"
set :domain, "#{user}@#{server}"
set :deploy_to, "/www/#{server}"
set :thin_port, 8013
set :thin_socket, nil
set :thin_servers, 1
set :thin_rackup, "#{deploy_to}/current/rackup.ru"
set :local_port, 9393
 
require "vlad"
 
namespace :vlad do
desc "Deploy the code and restart the server"
task :deploy => [:update, :start_app]
end
 
namespace :dev do
task :start_shotgun do
system "shotgun --port=#{local_port} rackup.ru"
end
 
desc "Start ssh tunnel between #{server}:#{thin_port} and localhost:#{local_port}"
task :start_tunnel do
puts "Tunneling #{server}:#{thin_port} to localhost:#{local_port}"
system "autossh -M 48484 -nNT -g -R *:#{thin_port}:127.0.0.1:#{local_port} #{server}"
end
desc "Switch to tunneled development mode."
multitask :start => [ "vlad:stop_app", "dev:start_shotgun", "dev:start_tunnel" ]
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.