Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set :runner, "aboutredlands"
- set :use_sudo, false
- # =============================================================================
- # CUSTOM OPTIONS
- # =============================================================================
- set :user, "aboutredlands"
- set :application, "about_redlands2"
- set :domain
- role :web, domain
- role :app, domain
- role :db, domain, :primary => true
- # =============================================================================
- # DATABASE OPTIONS
- # =============================================================================
- set :rails_env, "production"
- # =============================================================================
- # DEPLOY TO
- # =============================================================================
- set :deploy_to, "/home/#{user}/apps/#{application}"
- # =============================================================================
- # REPOSITORY
- # =============================================================================
- set :scm, "git"
- set :repository, "/Users/ryan/Documents/RWLD/rails/#{application}"
- set :branch, "master"
- set :deploy_via, :copy
- set :copy_exclude, [".svn", ".git"]
- # =============================================================================
- # SSH OPTIONS
- # =============================================================================
- default_run_options[:pty] = true
- ssh_options[:paranoid] = false
- ssh_options[:keys] = %w(/Users/ryan/.ssh/id_rsa)
- ssh_options[:port] = 22
- # =============================================================================
- # RAKE TASKS & OTHER SERVER TASKS
- # =============================================================================
- desc 'Fix attachment_fu'
- task :fix_attachment_fu, :roles => :app do
- %w{attachments banners features logos pdfs}.each do |share|
- run "rm -rf #{release_path}/public/#{share}"
- run "mkdir -p #{shared_path}/system/#{share}"
- run "ln -nfs #{shared_path}/system/#{share} #{release_path}/public/#{share}"
- end
- end
- desc "Create symlink to public_html/#{domain}/public"
- task :symlinkify do
- run "rm -rf /home/#{user}/public_html; ln -s /home/#{user}/apps/#{application}/current/public /home/#{user}/public_html"
- end
- # say release path
- desc "Say realease path"
- task :say_release_path do
- run "printf #{release_path} #{shared_path}"
- end
- desc "Reload Pasenger"
- task :reload_passenger do
- run "touch #{release_path}/tmp/restart.txt"
- end
- #build Assests
- desc "Build JS and CSS Assets"
- task :build_asset_packeges do
- run <<-EOF
- cd #{release_path} && rake asset:packager:build_all
- EOF
- end
- #clear action cache
- desc "Clear Action Cache"
- task :clear_action_cache do
- run <<-EOF
- cd #{release_path} && rake tmp:cache:clear
- EOF
- end
- #desc "Reload Apache"
- #task :reload_apache do
- # sudo "/etc/init.d/apache2 reload"
- #end
- # doesn't work yet, but would be good to add.
- # desc 'Install all gems'
- # task :rake_gems, :roles => :app do
- # run "cd #{release_path}"
- # run "rake gems:install"
- # end
- after "deploy", "deploy:migrations"
- after "deploy:migrations", "deploy:cleanup"
- after "deploy:cleanup", "symlinkify"
- after "symlinkify", "fix_attachment_fu"
- after "fix_attachment_fu", "build_asset_packeges"
- after "build_asset_packeges", "clear_action_cache"
- after "clear_action_cache", "reload_passenger"
Add Comment
Please, Sign In to add comment