Sha256: 34f7e7d0f24404b7659f9be5d5c6350a3b63bf1dcebedb6d8a5a8eeea34f15cc
Contents?: true
Size: 956 Bytes
Versions: 1
Compression:
Stored size: 956 Bytes
Contents
# TODO This file needs some love. # namespace :server do def chdir_to_root Dir.chdir SEARCH_ROOT end def current_pid pid = `cat #{File.join(SEARCH_ROOT, 'tmp/pids/unicorn.pid')}` pid.blank? ? nil : pid.chomp end desc "Start the unicorns. Weheee!" task :start => :framework do chdir_to_root # Rake::Task[:"solr:start"].invoke # TODO Move to better place. daemonize = SEARCH_ENVIRONMENT == 'production' ? '-D' : '' command = "export SEARCH_ENV=#{SEARCH_ENVIRONMENT}; unicorn -c unicorn.ru #{daemonize}".strip puts "Running \`#{command}\`." exec command end desc "Stop the unicorns. Blam!" task :stop => :framework do `kill -QUIT #{current_pid}` if current_pid # Rake::Task[:"solr:stop"].invoke # TODO Move to better place. end desc "Restart the unicorns!" task :restart do Rake::Task[:"server:stop"].invoke sleep 5 Rake::Task[:"server:start"].invoke end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
picky-0.0.5 | lib/tasks/server.rake |