Skip to content

Instantly share code, notes, and snippets.

@flyerhzm
Created February 1, 2012 10:51
Show Gist options
  • Save flyerhzm/1716458 to your computer and use it in GitHub Desktop.
Save flyerhzm/1716458 to your computer and use it in GitHub Desktop.
railsbp sinatra proxy deploy example
require 'bundler/capistrano'
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :rvm_ruby_string, 'ruby-1.9.2@sinatra-proxy' # Or whatever env you want it to run in.
set :rvm_bin_path, "/usr/local/rvm/bin"
set :application, "railsbp sinatra proxy"
set :repository, "git://github.com/railsbp/sinatra-proxy.git"
set :scm, :git
set :deploy_to, DEPLOY_PATH
set :user, :deploy
set :use_sudo, false
role :web, YOUR_SERVER
role :app, YOUR_SERVER
after "deploy:update_code", "config:init"
namespace :config do
task :init do
run "ln -nfs #{shared_path}/config/railsbp.yml #{release_path}/config/railsbp.yml"
run "ln -nfs #{shared_path}/config/rails_best_practices.yml #{release_path}/config/rails_best_practices.yml"
end
end
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
cleanup
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment