Sha256: 9a8b539776ac239f0a87fa32d6bdd7a5fe047544e2146cacfa5082432fe82d8a

Contents?: true

Size: 772 Bytes

Versions: 7

Compression:

Stored size: 772 Bytes

Contents

namespace(:ec2) do        
  task :init do
    Application.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

7 entries across 7 versions & 3 rubygems

Version Path
auser-poolparty-0.0.8 lib/poolparty/tasks/ec2.rake
auser-poolparty-0.0.9 lib/poolparty/tasks/ec2.rake
auser-poolparty-0.1.0 lib/poolparty/tasks/ec2.rake
auser-poolparty-0.1.1 lib/poolparty/tasks/ec2.rake
auser-poolparty-0.1.2 lib/poolparty/tasks/ec2.rake
dreadpiratepj-poolparty-0.0.8 lib/poolparty/tasks/ec2.rake
jtzemp-poolparty-0.1.2 lib/poolparty/tasks/ec2.rake