guignol 0.3.5.1 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby-version +1 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +15 -15
- data/guignol.gemspec +3 -2
- data/lib/guignol/commands/dns.rb +28 -0
- data/lib/guignol/configuration.rb +1 -1
- data/lib/guignol/models/instance.rb +9 -3
- data/lib/guignol/shell.rb +1 -0
- data/lib/guignol/version.rb +1 -1
- data/spec/guignol/configuration_spec.rb +10 -9
- data/spec/spec_helper.rb +4 -2
- metadata +10 -8
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.2-p320
|
data/Gemfile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gemspec
|
3
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
guignol (0.3.
|
4
|
+
guignol (0.3.6)
|
5
5
|
activesupport
|
6
|
-
fog (~> 1.
|
7
|
-
parallel (~> 0.
|
6
|
+
fog (~> 1.9.0)
|
7
|
+
parallel (~> 0.6.2)
|
8
8
|
thor
|
9
9
|
uuidtools
|
10
10
|
|
11
11
|
GEM
|
12
|
-
remote:
|
12
|
+
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activesupport (3.2.
|
14
|
+
activesupport (3.2.12)
|
15
15
|
i18n (~> 0.6)
|
16
16
|
multi_json (~> 1.0)
|
17
|
-
builder (3.1.
|
17
|
+
builder (3.1.4)
|
18
18
|
coderay (1.0.7)
|
19
19
|
diff-lcs (1.1.3)
|
20
|
-
excon (0.
|
21
|
-
fog (1.
|
20
|
+
excon (0.17.0)
|
21
|
+
fog (1.9.0)
|
22
22
|
builder
|
23
23
|
excon (~> 0.14)
|
24
24
|
formatador (~> 0.2.0)
|
@@ -28,16 +28,16 @@ GEM
|
|
28
28
|
net-ssh (>= 2.1.3)
|
29
29
|
nokogiri (~> 1.5.0)
|
30
30
|
ruby-hmac
|
31
|
-
formatador (0.2.
|
31
|
+
formatador (0.2.4)
|
32
32
|
i18n (0.6.1)
|
33
33
|
method_source (0.8)
|
34
|
-
mime-types (1.
|
35
|
-
multi_json (1.
|
34
|
+
mime-types (1.21)
|
35
|
+
multi_json (1.6.1)
|
36
36
|
net-scp (1.0.4)
|
37
37
|
net-ssh (>= 1.99.1)
|
38
|
-
net-ssh (2.6.
|
39
|
-
nokogiri (1.5.
|
40
|
-
parallel (0.
|
38
|
+
net-ssh (2.6.5)
|
39
|
+
nokogiri (1.5.6)
|
40
|
+
parallel (0.6.2)
|
41
41
|
pry (0.9.10)
|
42
42
|
coderay (~> 1.0.5)
|
43
43
|
method_source (~> 0.8)
|
@@ -55,7 +55,7 @@ GEM
|
|
55
55
|
rspec-mocks (2.4.0)
|
56
56
|
ruby-hmac (0.4.0)
|
57
57
|
slop (3.3.3)
|
58
|
-
thor (0.
|
58
|
+
thor (0.17.0)
|
59
59
|
uuidtools (2.1.3)
|
60
60
|
|
61
61
|
PLATFORMS
|
data/guignol.gemspec
CHANGED
@@ -22,8 +22,9 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_development_dependency "pry"
|
23
23
|
s.add_development_dependency "pry-nav"
|
24
24
|
|
25
|
-
|
26
|
-
s.add_dependency "
|
25
|
+
|
26
|
+
s.add_dependency "fog", "~> 1.9.0"
|
27
|
+
s.add_dependency "parallel", '~> 0.6.2'
|
27
28
|
s.add_dependency "activesupport"
|
28
29
|
s.add_dependency "uuidtools"
|
29
30
|
s.add_dependency "thor"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
require 'guignol/commands/base'
|
3
|
+
require 'guignol/models/instance'
|
4
|
+
|
5
|
+
Guignol::Shell.class_eval do
|
6
|
+
desc 'dns [PATTERNS]', 'Prints the DNS mappings for servers matching PATTERNS'
|
7
|
+
def dns(*patterns)
|
8
|
+
patterns.push('.*') if patterns.empty?
|
9
|
+
Guignol::Commands::DNS.new(patterns).run
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
module Guignol::Commands
|
15
|
+
class DNS < Base
|
16
|
+
def run_on_server(instance, options = {})
|
17
|
+
synchronize do
|
18
|
+
shell.say instance.name.ljust(@max_width + 1)
|
19
|
+
shell.say instance.dns_name
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def before_run(configs, options = {})
|
24
|
+
@max_width = configs.keys.map(&:size).max
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
@@ -135,15 +135,21 @@ module Guignol::Models
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
|
-
|
138
|
+
# Route53's API is not concurrently accessible
|
139
|
+
DNS_MUTEX.synchronize do
|
140
|
+
dns_zone.records.create(:name => fqdn, :type => 'CNAME', :value => subject.dns_name, :ttl => 5)
|
141
|
+
end
|
139
142
|
log "#{fqdn} -> #{subject.dns_name}"
|
140
143
|
return self
|
141
144
|
end
|
142
145
|
|
146
|
+
def dns_name
|
147
|
+
subject && subject.dns_name
|
148
|
+
end
|
149
|
+
|
143
150
|
|
144
151
|
private
|
145
152
|
|
146
|
-
|
147
153
|
def default_options
|
148
154
|
{ :volumes => {} }
|
149
155
|
end
|
@@ -211,7 +217,7 @@ module Guignol::Models
|
|
211
217
|
unless dns_record_matches?(record)
|
212
218
|
log "warning, while removing, DNS record exist but does not point to the current server"
|
213
219
|
end
|
214
|
-
record.destroy
|
220
|
+
DNS_MUTEX.synchronize { record.destroy }
|
215
221
|
end
|
216
222
|
|
217
223
|
return self
|
data/lib/guignol/shell.rb
CHANGED
data/lib/guignol/version.rb
CHANGED
@@ -6,19 +6,20 @@ describe Guignol::Configuration do
|
|
6
6
|
let(:test_path) { Pathname.new 'tmp/test.yml' }
|
7
7
|
let(:result) { subject.configuration }
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
shared_examples_for 'loaded config' do
|
10
|
+
before do
|
11
|
+
ENV['GUIGNOL_YML'] = test_path.to_s
|
12
|
+
test_path.open('w') do |io|
|
13
|
+
io.write config_data
|
14
|
+
end
|
13
15
|
end
|
14
|
-
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
after do
|
18
|
+
test_path.delete
|
19
|
+
end
|
19
20
|
|
20
|
-
shared_examples_for 'loaded config' do
|
21
21
|
it 'should load' do
|
22
|
+
test_path.should exist
|
22
23
|
result.should be_a_kind_of(Hash)
|
23
24
|
end
|
24
25
|
|
data/spec/spec_helper.rb
CHANGED
@@ -6,9 +6,11 @@ Fog.mock!
|
|
6
6
|
|
7
7
|
ENV['GUIGNOL_ENV'] = 'test'
|
8
8
|
ENV['GUIGNOL_LOG'] = '/dev/null'
|
9
|
+
ENV['AWS_SECRET_KEY_ID'] = 'aws-key-id'
|
10
|
+
ENV['AWS_SECRET_ACCESS_KEY'] = 'aws-password'
|
9
11
|
|
10
12
|
RSpec.configure do |config|
|
11
13
|
config.before do
|
12
|
-
Fog::Mock.reset
|
14
|
+
Fog::Mock.reset
|
13
15
|
end
|
14
|
-
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guignol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - ~>
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 1.
|
101
|
+
version: 1.9.0
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 1.
|
109
|
+
version: 1.9.0
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: parallel
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
117
|
+
version: 0.6.2
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - ~>
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.
|
125
|
+
version: 0.6.2
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: activesupport
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,6 +182,7 @@ extra_rdoc_files: []
|
|
182
182
|
files:
|
183
183
|
- .gitignore
|
184
184
|
- .rspec
|
185
|
+
- .ruby-version
|
185
186
|
- Gemfile
|
186
187
|
- Gemfile.lock
|
187
188
|
- LICENCE
|
@@ -195,6 +196,7 @@ files:
|
|
195
196
|
- lib/guignol/commands/base.rb
|
196
197
|
- lib/guignol/commands/clone.rb
|
197
198
|
- lib/guignol/commands/create.rb
|
199
|
+
- lib/guignol/commands/dns.rb
|
198
200
|
- lib/guignol/commands/execute.rb
|
199
201
|
- lib/guignol/commands/fix_dns.rb
|
200
202
|
- lib/guignol/commands/kill.rb
|
@@ -232,7 +234,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
232
234
|
version: '0'
|
233
235
|
segments:
|
234
236
|
- 0
|
235
|
-
hash:
|
237
|
+
hash: 3742329953402264220
|
236
238
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
237
239
|
none: false
|
238
240
|
requirements:
|
@@ -241,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
243
|
version: 1.3.6
|
242
244
|
requirements: []
|
243
245
|
rubyforge_project:
|
244
|
-
rubygems_version: 1.8.
|
246
|
+
rubygems_version: 1.8.23
|
245
247
|
signing_key:
|
246
248
|
specification_version: 3
|
247
249
|
summary: Manipulate Amazon EC2 instances
|