Changeset 486

Show
Ignore:
Timestamp:
06/03/08 23:00:00 (7 months ago)
Author:
mbailey
Message:

tidy up

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/deprec/recipes/sphinx.rb

    r464 r486  
    2323      end 
    2424     
    25       # install dependencies for nginx 
     25      # install dependencies for sphinx 
    2626      task :install_deps do 
    2727        # apt.install( {:base => %w(blah)}, :stable ) 
     
    4040 
    4141      desc <<-DESC 
    42       Generate nginx config from template. Note that this does not 
     42      Generate sphinx config from template. Note that this does not 
    4343      push the config to the server, it merely generates required 
    4444      configuration files. These should be kept under source control.             
     
    5151      end 
    5252 
    53       desc "Push nginx config files to server" 
     53      desc "Push sphinx config files to server" 
    5454      task :config, :roles => :sphinx do 
    5555        config_project 
    5656      end 
    5757       
    58       desc "Push nginx config files to server" 
     58      desc "Push sphinx config files to server" 
    5959      task :config_project, :roles => :sphinx do 
    6060        deprec2.push_configs(:sphinx, PROJECT_CONFIG_FILES[:sphinx]) 
     
    6666      end 
    6767 
    68       desc <<-DESC 
    69       Activate nginx start scripts on server. 
    70       Setup server to start nginx on boot. 
    71       DESC 
    72       task :activate, :roles => :web do 
    73         activate_system 
     68 
     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 ? ### 
    7474      end 
    7575 
    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 ? ### 
    12079      end 
    12180