Sha256: 39533ad74111702a39e37464840fc6a0a48e5c42a80d39ccfe5e8ddc66366db6

Contents?: true

Size: 1.87 KB

Versions: 10

Compression:

Stored size: 1.87 KB

Contents

Capistrano::Configuration.instance(true).load do
  set :juggernaut_config, "#{current_path}/config/juggernaut.yml"
  set :juggernaut_pid, "#{current_path}/tmp/pids/juggernaut.pid"
  set :juggernaut_log, "#{current_path}/log/juggernaut.log"
  set :juggernaut_role, :app
  set :base_ruby_path,  '/usr'

  namespace :juggernaut do

    # ===============================================================
    # PROCESS MANAGEMENT
    # ===============================================================

    desc "Starts the juggernaut push server"
    task :start, :roles => juggernaut_role do
      utilities.with_role(juggernaut_role) do
        puts "Starting juggernaut push server"
        try_sudo "#{base_ruby_path}/bin/juggernaut -c #{juggernaut_config} -d --pid #{juggernaut_pid} --log #{juggernaut_log}"
      end
    end

    desc "Stops the juggernaut push server"
    task :stop, :roles => juggernaut_role do
      utilities.with_role(juggernaut_role) do
        puts "Stopping juggernaut push server"
        try_sudo "#{base_ruby_path}/bin/juggernaut -c #{juggernaut_config} -k * --pid #{juggernaut_pid} --log #{juggernaut_log}"
      end
    end

    desc "Restarts the juggernaut push server"
    task :restart, :roles => juggernaut_role do
      utilities.with_role(juggernaut_role) do
        juggernaut.stop
        juggernaut.start
      end
    end

    # ===============================================================
    # FILE MANAGEMENT
    # ===============================================================

    desc "Symlinks the shared/config/juggernaut yaml to release/config/"
    task :symlink_config, :roles => :app do
      try_sudo "ln -s #{shared_path}/config/juggernaut.yml #{release_path}/config/juggernaut.yml"
    end

    desc "Displays the juggernaut log from the server"
    task :tail, :roles => :app do
      stream "tail -f #{shared_path}/log/juggernaut.log"
    end

  end

end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
nesquena-cap-recipes-0.3.17 lib/cap_recipes/tasks/juggernaut/manage.rb
nesquena-cap-recipes-0.3.18 lib/cap_recipes/tasks/juggernaut/manage.rb
cap-recipes-0.3.26 lib/cap_recipes/tasks/juggernaut/manage.rb
cap-recipes-0.3.25 lib/cap_recipes/tasks/juggernaut/manage.rb
cap-recipes-0.3.24 lib/cap_recipes/tasks/juggernaut/manage.rb
cap-recipes-0.3.23 lib/cap_recipes/tasks/juggernaut/manage.rb
cap-recipes-0.3.22 lib/cap_recipes/tasks/juggernaut/manage.rb
cap-recipes-0.3.21 lib/cap_recipes/tasks/juggernaut/manage.rb
cap-recipes-0.3.20 lib/cap_recipes/tasks/juggernaut/manage.rb
cap-recipes-0.3.18 lib/cap_recipes/tasks/juggernaut/manage.rb