Skip to content

@tuupola /.htaccess
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Rake tasks for easier Facebook development.
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]
#
# Taken from http://www.appelsiini.net/2010/rake-tasks-for-facebook
# For Passenger and Apache
#
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 :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
#
# Taken from http://www.appelsiini.net/2010/rake-tasks-for-facebook
# For Thin and Apache
#
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
Something went wrong with that request. Please try again.