Sha256: 8aa072c567b3c504b46dbe31f06c9108d1f5909cf6ab08a472bb30602b14a2c4

Contents?: true

Size: 1.06 KB

Versions: 50

Compression:

Stored size: 1.06 KB

Contents

Capistrano::Configuration.instance.load do

  namespace :redis do

    desc "Install redis"
    task :install do
      ["#{sudo} rm -r /tmp/redis",
       "#{sudo} rm /usr/local/bin/redis-*",
       "git clone git://github.com/antirez/redis.git /tmp/redis",
       "cd /tmp/redis && git pull",
       "cd /tmp/redis && git checkout v2.0.4-stable",
       "cd /tmp/redis && make clean",
       "cd /tmp/redis && make",
       "cd /tmp/redis && #{sudo} make install",
       "#{sudo} cp /tmp/redis/redis.conf /etc/",
       "#{sudo} sed -i 's/daemonize no/daemonize yes/' /etc/redis.conf",
       "#{sudo} sed -i 's/# bind 127.0.0.1/bind 127.0.0.1/' /etc/redis.conf"
      ].each {|cmd| run cmd}
    end

    desc "Start the Redis server"
    task :start do
      run "redis-server /etc/redis.conf"
    end

    desc "Stop the Redis server"
    task :stop do
      run 'echo "SHUTDOWN" | nc localhost 6379'
      #sudo 'kill `cat /var/run/redis.pid`'
    end

    desc "Restart the Redis server"
    task :restart do
      redis.stop
      sleep(1)
      redis.start
    end

  end

end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
caploy-0.2.5 lib/caploy/recipes/redis.rb
caploy-0.2.4 lib/caploy/recipes/redis.rb
caploy-0.2.3 lib/caploy/recipes/redis.rb
caploy-0.2.2 lib/caploy/recipes/redis.rb
caploy-0.2.1 lib/caploy/recipes/redis.rb
caploy-0.2.0 lib/caploy/recipes/redis.rb
caploy-0.1.12 lib/caploy/recipes/redis.rb
caploy-0.1.11 lib/caploy/recipes/redis.rb
caploy-0.1.10 lib/caploy/recipes/redis.rb
caploy-0.1.9 lib/caploy/recipes/redis.rb
caploy-0.1.8 lib/caploy/recipes/redis.rb
caploy-0.1.7 lib/caploy/recipes/redis.rb
caploy-0.1.6 lib/caploy/recipes/redis.rb
caploy-0.1.5 lib/caploy/recipes/redis.rb
caploy-0.1.4 lib/caploy/recipes/redis.rb
caploy-0.1.3 lib/caploy/recipes/redis.rb
caploy-0.1.2 lib/caploy/recipes/redis.rb
caploy-0.1.1 lib/caploy/recipes/redis.rb
caploy-0.1.0 lib/caploy/recipes/redis.rb
ms_deploy-0.3.6 lib/ms_deploy/recipes/redis.rb