Sha256: 010f4863f73f22f87178ae727828ec20bf402be9b5123472959f0494dd132a72

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

#!/usr/bin/env ruby
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "poolparty"
require "poolpartycl"

o = PoolParty::Optioner.new(ARGV) do |opts, optioner|  
  opts.on('-n cloudname', '--name name', 'Start cloud by this name')    { |c| optioner.cloudname c }
  opts.on('-d', '--daemonize', 'Daemonize starting the cloud')    { optioner.daemon true }
end

o.loaded_clouds.each do |cloud|
  with_cloud(cloud) do
    vputs header("Starting cloud #{name}")
    vputs "#{list_of_running_instances.size} running instances (#{minimum_instances} - #{maximum_instances})"
    # if list_of_running_instances.size <= 1
      puts "Starting the master instance"    
      # if testing
      #   puts("\tNot launching while in testing mode")
      # else
        vputs "Launching and configuring the master"
        daemon ? daemonize {launch_and_configure_master!} : launch_and_configure_master!
      # end
    # end
    when_no_pending_instances do
      puts open(::File.join(File.dirname(__FILE__), "..", "lib", "poolparty", "config", "postlaunchmessage.txt")).read ^ {:master_ip => master.ip.chomp}
      clear_base_directory unless testing
    end
  end
  
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
auser-poolparty-0.2.67 bin/cloud-start
auser-poolparty-0.2.68 bin/cloud-start
poolparty-0.2.69 bin/cloud-start