Changeset 486
- Timestamp:
- 06/03/08 23:00:00 (7 months ago)
- Files:
-
- trunk/lib/deprec/recipes/sphinx.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/deprec/recipes/sphinx.rb
r464 r486 23 23 end 24 24 25 # install dependencies for nginx25 # install dependencies for sphinx 26 26 task :install_deps do 27 27 # apt.install( {:base => %w(blah)}, :stable ) … … 40 40 41 41 desc <<-DESC 42 Generate nginx config from template. Note that this does not42 Generate sphinx config from template. Note that this does not 43 43 push the config to the server, it merely generates required 44 44 configuration files. These should be kept under source control. … … 51 51 end 52 52 53 desc "Push nginx config files to server"53 desc "Push sphinx config files to server" 54 54 task :config, :roles => :sphinx do 55 55 config_project 56 56 end 57 57 58 desc "Push nginx config files to server"58 desc "Push sphinx config files to server" 59 59 task :config_project, :roles => :sphinx do 60 60 deprec2.push_configs(:sphinx, PROJECT_CONFIG_FILES[:sphinx]) … … 66 66 end 67 67 68 desc <<-DESC 69 Activate nginx start scripts on server.70 Setup server to start nginx on boot.71 DESC72 task : activate, :roles => :webdo73 activate_system68 69 # Control 70 71 desc "Restart the sphinx searchd daemon" 72 task :restart, :roles => :app do 73 run("cd #{deploy_to}/current; /usr/bin/rake us:start") ### start or restart? SUDO ? ### 74 74 end 75 75 76 task :activate_system, :roles => :web do 77 send(run_method, "update-rc.d nginx defaults") 78 end 79 80 desc <<-DESC 81 Dectivate nginx start scripts on server. 82 Setup server to start nginx on boot. 83 DESC 84 task :deactivate, :roles => :web do 85 send(run_method, "update-rc.d -f nginx remove") 86 end 87 88 89 # Control 90 91 desc "Start Nginx" 92 task :start, :roles => :web do 93 send(run_method, "/etc/init.d/nginx start") 94 end 95 96 desc "Stop Nginx" 97 task :stop, :roles => :web do 98 send(run_method, "/etc/init.d/nginx stop") 99 end 100 101 desc "Restart Nginx" 102 task :restart, :roles => :web do 103 # So that restart will work even if nginx is not running 104 # we call stop and ignore the return code. We then start it. 105 send(run_method, "/etc/init.d/nginx stop; exit 0") 106 send(run_method, "/etc/init.d/nginx start") 107 end 108 109 desc "Reload Nginx" 110 task :reload, :roles => :web do 111 send(run_method, "/etc/init.d/nginx reload") 112 end 113 114 task :backup, :roles => :web do 115 # there's nothing to backup for nginx 116 end 117 118 task :restore, :roles => :web do 119 # there's nothing to store for nginx 76 desc "Regenerate / Rotate the search index." 77 task :reindex, :roles => :app do 78 run("cd #{deploy_to}/current; /usr/bin/rake us:in") ### SUDO ? ### 120 79 end 121 80
