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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +12 -8
- data/capistrano-ec2ami.gemspec +2 -2
- data/lib/capistrano-ec2ami.rb +15 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2835f14f1aa866ae1013f998725d4a120332e94b
|
4
|
+
data.tar.gz: 135be9782edb49f02fe154dc7ba05ea0ce02b84b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5a6a6e11df8accf482bda6f65e7e611aab74a4fedaef034783a76c4b052e21b4f9e9552a6bf4ed2ba8829257c3c69fb0eae08c43b9e8ba1dbfbbb0f9ccc2faa
|
7
|
+
data.tar.gz: bd6b694770886ac9f0b0828815f87a3ce6dd97a13318344cdc1a17b877fce834d3ddb01840e791e0e65722f45121931fe0d7c2a77cf9082b33690ad643c15b99
|
data/Gemfile.lock
CHANGED
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
|
-
|
7
|
+
To get started, set the following variables in your capistrano settings
|
8
|
+
file:
|
8
9
|
|
9
10
|
```
|
10
|
-
|
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
|
-
|
13
|
-
|
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
|
data/capistrano-ec2ami.gemspec
CHANGED
@@ -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.
|
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) }
|
data/lib/capistrano-ec2ami.rb
CHANGED
@@ -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
|
67
|
+
def create_ami
|
64
68
|
logger.info "\e[1;44m ## Creating AMI!\e[0m"
|
65
|
-
instance = find_instance_id(roles[
|
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
|
-
|
70
|
-
|
71
|
-
|
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.
|
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-
|
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: {}
|