Skip to content

Instantly share code, notes, and snippets.

@rduarte
Created June 8, 2010 00:08
Show Gist options
  • Save rduarte/429387 to your computer and use it in GitHub Desktop.
Save rduarte/429387 to your computer and use it in GitHub Desktop.
capify .
# [add] writing `./Capfile'
# [skip] `./Capfile' already exists
# [add] writing `./config/deploy.rb'
# [done] capified!
role :web, "dominio.com.br"
role :app, "dominio.com.br"
set :application, "aplicacao"
set :repository, "."
set :scm, :none
set :deploy_via, :copy
set :copy_compression, :bz2
set :copy_exclude, ["lixo", "config"]
set :user, "usuario"
set :use_sudo, false
set :keep_releases, 5
set :app_symlinks, ["f"]
set :normalize_asset_timestamps, false
set :deploy_to, "~/php_apps/#{application}"
set :public_path, "~/public_html"
ssh_options[:keys] = ["#{ENV['HOME']}/.ssh/id_rsa"]
namespace :deploy do
# Anula o restart do servidor
desc "Fake restart"
task :restart, :roles => :app do
run "exit"
end
end
task :define_conf_files, :roles => [:app] do
run "rm -rfd #{release_path}/conf.php"
run "ln -nfs #{release_path}/conf-online.php #{release_path}/conf.php"
end
desc "Setup application symlinks in the public"
task :symlinks_setup, :roles => [:web] do
if app_symlinks
app_symlinks.each { |link| run "mkdir -p #{shared_path}/public/#{link}" }
end
end
desc "Link public directories to shared location."
task :symlinks_update, :roles => [:web] do
if app_symlinks
app_symlinks.each { |link| run "ln -nfs #{shared_path}/public/#{link} #{current_path}/#{link}" }
end
run "ln -nfs #{current_path} #{public_path}"
end
after "deploy:update_code", :define_conf_files
after "deploy:symlink", "symlinks_update"
cap deploy:rollback
cap deploy:setup
sudo gem install capistrano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment