Sha256: 50132cab4f8d991be1456c3133b5599aebabfbe1ec041c0babe08c3ce1aa65f3

Contents?: true

Size: 1.85 KB

Versions: 22

Compression:

Stored size: 1.85 KB

Contents

# Tasks to be run on the server
namespace :poolparty do
  namespace :server do                
    task :init  do
      PoolParty::Coordinator.init(false)
    end
    # bundle, upload and register your bundle on the server
    desc "Bundle, upload and register your ami"
    task :all => [:bundle, :upload, :register] do
      puts "== your ami is ready"
    end
    # Cleanup the /mnt directory
    desc "Clean the /mnt directory"
    task :clean_mnt do
      `rm -rf /mnt/image* img*`
    end
    # Before we can bundle, we have to make sure we have the cert and pk files
    desc "Ensure the required bundle files are present in /mnt"
    task :check_bundle_files do
      raise Exception.new("You must have a private key in your /mnt directory") unless File.exists?("/mnt/pk-*.pem")
      raise Exception.new("You must have your access key in your /mnt directory") unless File.exists?("/mnt/cert-*.pem")          
    end
    # Bundle the image
    desc "Bundle this image into the /mnt directory"
    task :bundle => [:clean_mnt, :check_bundle_files] do
      puts `ec2-bundle-vol -k /mnt/pk-*.pem -u '#{Planner.user_id}' -d /mnt -c /mnt/cert-*.pem -r i386`
    end
    # Upload the bundle into the app_name bucket
    desc "Upload the bundle to your bucket with a unique name: deletes old ami"
    task :upload => [:init, :delete_bucket] do
      puts `ec2-upload-bundle -b #{Planner.app_name} -m /mnt/image.manifest.xml -a #{Planner.access_key} -s #{Planner.secret_access_key}`
    end
    # Register the bucket with amazon and get back an ami
    desc "Register the bundle with amazon"
    task :register do
      puts `ec2-register -K /mnt/pk-*.pem -C /mnt/cert-*.pem #{Planner.app_name}/image.manifest.xml`
    end
    # Delete the bucket
    desc "Delete the bucket with the bundle under tha app name"
    task :delete_bucket do
      Planner.app_name.delete_bucket 
    end
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
auser-poolparty-1.1.1 tasks/server.rake
auser-poolparty-1.1.3 tasks/server.rake
auser-poolparty-1.1.4 tasks/server.rake
auser-poolparty-1.1.5 tasks/server.rake
auser-poolparty-1.1.6 tasks/server.rake
auser-poolparty-1.1.7 tasks/server.rake
auser-poolparty-1.2.0 tasks/server.rake
auser-poolparty-1.2.1 tasks/server.rake
auser-poolparty-1.2.10 tasks/server.rake
auser-poolparty-1.2.11 tasks/server.rake
auser-poolparty-1.2.12 tasks/server.rake
auser-poolparty-1.2.2 tasks/server.rake
auser-poolparty-1.2.3 tasks/server.rake
auser-poolparty-1.2.4 tasks/server.rake
auser-poolparty-1.2.7 tasks/server.rake
auser-poolparty-1.2.8 tasks/server.rake
auser-poolparty-1.2.9 tasks/server.rake
fairchild-poolparty-1.1.3 tasks/server.rake
fairchild-poolparty-1.1.4 tasks/server.rake
fairchild-poolparty-1.1.5 tasks/server.rake