Created
June 16, 2010 18:29
-
-
Save tuupola/441078 to your computer and use it in GitHub Desktop.
Rake tasks for easier Facebook development.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment