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 hidden or 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
RewriteEngine On | |
RewriteBase / | |
# Everything not found goes to Sinatra / Rack | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule (.*) http://127.0.0.1:4567%{REQUEST_URI} [L,P,QSA] |
This file contains hidden or 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 | |
# For Passenger and Apache | |
# | |
set :application, "foo-bar" | |
set :repository, "[email protected]:username/#{application}.git" | |
set :user, "sinatra" | |
set :server, "#{application}.example.com" | |
set :domain, "#{user}@#{server}" | |
set :deploy_to, "/www/#{server}" | |
set :remote_port, 4567 | |
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}:#{remote_port} and localhost:#{local_port}" | |
task :start_tunnel do | |
puts "Tunneling #{server}:#{remote_port} to localhost:#{local_port}" | |
system "autossh -M 48484 -nNT -g -R *:#{remote_port}:127.0.0.1:#{local_port} #{server}" | |
end | |
remote_task :symlink do | |
puts "Symlinking shared/htaccess to current/public/.htaccess" | |
run "rm #{current_release}/public/.htaccess" | |
run "ln -s #{shared_path}/htaccess #{current_release}/public/.htaccess" | |
end | |
desc "Switch to tunneled development mode." | |
multitask :start => [ "dev:symlink", "dev:start_shotgun", "dev:start_tunnel" ] | |
end |
This file contains hidden or 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 | |
# For Thin and Apache | |
# | |
set :application, "foo-bar" | |
set :repository, "[email protected]: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