Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 44 lines (35 sloc) 1.544 kb
99da426 @zk Initial commit after nuking history (pws and keys in history).
authored
1 load 'deploy' if respond_to?(:namespace) # cap2 differentiator
2 Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
3
4 load 'config/deploy' # remove this line to skip loading any of the default tasks
5
55da58f @zk Switched to including rcov tasks only if env != production
authored
6 after "deploy:update", :copy_database_yml
99da426 @zk Initial commit after nuking history (pws and keys in history).
authored
7 after "deploy:update", :set_permissions
8 after "deploy:update", :update_sphinx
9 after "deploy:setup", :create_database
10
11 task :create_database, :role => [:web, :app] do
55da58f @zk Switched to including rcov tasks only if env != production
authored
12 run "echo 'create database clojuredocs_production' | mysql -u#{db_user}"
13 end
14
15 task :copy_database_yml, :role => [:web, :app] do
16 run "cp #{release_path}/config/database.example.yml #{release_path}/config/database.yml"
99da426 @zk Initial commit after nuking history (pws and keys in history).
authored
17 end
18
19 task :set_permissions, :role => [:web, :app] do
55da58f @zk Switched to including rcov tasks only if env != production
authored
20 run "chown -R nobody #{release_path}/tmp"
21 run "chown -R nobody #{release_path}/public"
22 run "touch #{release_path}/log/production.log"
23 run "chmod 0666 #{release_path}/log/production.log"
99da426 @zk Initial commit after nuking history (pws and keys in history).
authored
24 end
25
55da58f @zk Switched to including rcov tasks only if env != production
authored
26 namespace :bundler do
27 task :create_symlink, :roles => :app do
28 shared_dir = File.join(shared_path, 'bundle')
29 release_dir = File.join(current_release, '.bundle')
30 run("mkdir -p #{shared_dir} && ln -s #{shared_dir} #{release_dir}")
31 end
32
33 task :bundle_new_release, :roles => :app do
34 bundler.create_symlink
35 run "cd #{release_path} && /opt/ruby-enterprise/bin/bundle install --without test"
36 end
99da426 @zk Initial commit after nuking history (pws and keys in history).
authored
37 end
55da58f @zk Switched to including rcov tasks only if env != production
authored
38
39 after 'deploy:update_code', 'bundler:bundle_new_release'
99da426 @zk Initial commit after nuking history (pws and keys in history).
authored
40
41 task :update_sphinx, :role => [:web, :app] do
42 run("killall searchd; true")
43 run("cd #{deploy_to}/current && #{rake} thinking_sphinx:rebuild RAILS_ENV=production")
44 end
Something went wrong with that request. Please try again.