Sha256: df8e4c50e1a94e8c617ee60ae73db1b4346b3dd297fb99a05af9ad9f2e8a2679

Contents?: true

Size: 765 Bytes

Versions: 2

Compression:

Stored size: 765 Bytes

Contents

namespace(:ec2) do        
  task :init do
    Base.options
  end
  # Start a new instance in the cloud
  desc "Add and start an instance to the pool"
  task :start_new_instance => [:init] do
    puts PoolParty::Remoting.new.launch_new_instance!
  end
  # Stop all the instances via command-line
  desc "Stop all running instances"
  task :stop_running_instances => [:init] do
    Thread.new {`ec2-describe-instances | grep INSTANCE | grep running | awk '{print $2}' | xargs ec2-terminate-instances`}
  end
  # Reboot the instances via commandline
  desc "Restart all running instances"
  task :restart_running_instances => [:init] do
    Thread.new {`ec2-describe-instances | grep INSTANCE | grep running | awk '{print $2}' | xargs ec2-reboot-instances`}
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
auser-poolparty-0.2.2 tasks/ec2.rake
auser-poolparty-0.2.3 tasks/ec2.rake