capistrano-ec2ami 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 636017ca7ebbbd82abc780c96fbfc882a42299e3
4
- data.tar.gz: 395b4d14e92b9af3b6b4a64fcf5bad07322fd84e
3
+ metadata.gz: 2835f14f1aa866ae1013f998725d4a120332e94b
4
+ data.tar.gz: 135be9782edb49f02fe154dc7ba05ea0ce02b84b
5
5
  SHA512:
6
- metadata.gz: 0d30568292efb623b0a1d1a891ef407c715e29eb55dcf40dbfc3d789651297e3f6b068b686770b9a07d9d72b9b4276e9e1f817867d7814c61ca5f220d793b9c4
7
- data.tar.gz: c199c23ef29d33ab9fa59c689b7eff1a6645a7f6d251b6b49392185001440508680a50a4772e7f5acf4bad47cd596889d3200799153977321e4033e1cab77c8a
6
+ metadata.gz: f5a6a6e11df8accf482bda6f65e7e611aab74a4fedaef034783a76c4b052e21b4f9e9552a6bf4ed2ba8829257c3c69fb0eae08c43b9e8ba1dbfbbb0f9ccc2faa
7
+ data.tar.gz: bd6b694770886ac9f0b0828815f87a3ce6dd97a13318344cdc1a17b877fce834d3ddb01840e791e0e65722f45121931fe0d7c2a77cf9082b33690ad643c15b99
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-ec2ami (1.0.0)
4
+ capistrano-ec2ami (1.0.2)
5
5
  capistrano (>= 2.1.0)
6
6
  fog (>= 1.5.0)
7
7
  rake
data/README.md CHANGED
@@ -4,19 +4,23 @@ Create AMI's from your EC2 instances with your capistrano scripts.
4
4
 
5
5
  ## Usage
6
6
 
7
- The following is a small example of how to create an AMI of a machine with role[:web]:
7
+ To get started, set the following variables in your capistrano settings
8
+ file:
8
9
 
9
10
  ```
10
- require 'capistrano-ec2ami'
11
+ set :ec2ami_role, :web
12
+ set :ec2ami_name, 'Awesome-AMI'
13
+ set :ec2ami_description, 'Awesome-description'
14
+ set :ec2ami_no_reboot, true
15
+ ```
11
16
 
12
- create_ami({
13
- role: :web
14
- name: 'ami-name-here',
15
- description: 'ami-description-here',
16
- no_reboot: true
17
- })
17
+ Then, issue the following callback to create an AMI of your EC2 instance
18
+ after a deployment
18
19
 
19
20
  ```
21
+ after 'deploy', 'ami:create'
22
+ ```
23
+
20
24
 
21
25
  ## Requirements
22
26
  You are expected to have ENV variables for your AWS credentials
@@ -5,12 +5,12 @@ require 'capistrano-ec2ami'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "capistrano-ec2ami"
8
- gem.version = '1.0.0'
8
+ gem.version = '1.0.2'
9
9
  gem.authors = ["Alfred Moreno"]
10
10
  gem.email = ["alfred.moreno@zumba.com"]
11
11
  gem.description = %q{A capistrano plugin for creating EC2 AMIs}
12
12
  gem.summary = %q{A capistrano plugin for creating EC2 AMIs}
13
- gem.homepage = ""
13
+ gem.homepage = "http://github.com/kryptek"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -18,6 +18,10 @@ module Capistrano
18
18
 
19
19
  _cset(:aws_secret_access_key, ENV['AWS_SECRET_ACCESS_KEY'])
20
20
  _cset(:aws_access_key_id, ENV['AWS_ACCESS_KEY_ID'])
21
+ _cset(:ec2ami_role, :web)
22
+ _cset(:ec2ami_name, "capistrano-ec2ami-#{Time.now.to_i}")
23
+ _cset(:ec2ami_description, "AMI created by capistrano-ec2ami (#{Time.now})")
24
+ _cset(:ec2ami_no_reboot, true)
21
25
 
22
26
  ######################################################################
23
27
  # def ec2
@@ -60,20 +64,26 @@ module Capistrano
60
64
  #
61
65
  # Returns: String
62
66
  ######################################################################
63
- def create_ami(options={})
67
+ def create_ami
64
68
  logger.info "\e[1;44m ## Creating AMI!\e[0m"
65
- instance = find_instance_id(roles[options[:role]].servers.sample.host).id
69
+ instance = find_instance_id(roles[fetch(:ec2ami_role)].servers.sample.host).id
66
70
 
67
71
  ami_id = ec2.create_image(
68
72
  instance,
69
- options[:name] || "capistrano-ec2ami-#{Time.now.to_i}",
70
- options[:description] || "AMI of instance #{instance} created by capistrano-ec2ami (#{Time.now})",
71
- options[:no_reboot] || true
73
+ fetch(:ec2ami_name),
74
+ fetch(:ec2ami_description),
75
+ fetch(:ec2ami_no_reboot)
72
76
  )
73
77
 
74
78
  logger.info "\e[1;44m Successfully created AMI: #{ami_id.body['imageId']}\e[0m"
75
79
  end
76
80
 
81
+ namespace :ami do
82
+ desc 'Creates an Amaazon EC2 AMI'
83
+ task :create, once: true, roles: (fetch(:ec2ami_role) || :web) do
84
+ create_ami
85
+ end
86
+ end
77
87
 
78
88
  end
79
89
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-ec2ami
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alfred Moreno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-08 00:00:00.000000000 Z
11
+ date: 2013-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -70,7 +70,7 @@ files:
70
70
  - lib/capistrano-ec2ami.rb
71
71
  - test/helper.rb
72
72
  - test/test_capistrano-ec2ami.rb
73
- homepage: ''
73
+ homepage: http://github.com/kryptek
74
74
  licenses:
75
75
  - MIT
76
76
  metadata: {}