Created
June 8, 2010 00:08
-
-
Save rduarte/429387 to your computer and use it in GitHub Desktop.
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
| capify . | |
| # [add] writing `./Capfile' | |
| # [skip] `./Capfile' already exists | |
| # [add] writing `./config/deploy.rb' | |
| # [done] capified! |
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
| cap deploy |
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
| 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" |
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
| cap deploy:rollback |
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
| cap deploy:setup |
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
| sudo gem install capistrano |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment