elbas 3.0.2 → 3.0.3

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
  SHA256:
3
- metadata.gz: 995fe56e0e1264e2da002e25c2d3987d4100dc0c1e539af8fbed211d3f76706a
4
- data.tar.gz: d53b2142afe2d59f9b00518f086c147a44a88ead7c0243b606ccf204958034c8
3
+ metadata.gz: 32639852b7a6af9bce74c3e376c271e4f7847bec72268de2d2f0d9533cea6138
4
+ data.tar.gz: 5ba3d1d1d1c599ad1c0a4bcc88643db6287e5cca6dad4deb49831a7ce7a36e8e
5
5
  SHA512:
6
- metadata.gz: 78b5b6892b5c0e45dfebb25ef9ef3d95df2f357ddc6f68b2f28dbccac1ea3e552558ef10e3840cb412bdb6440d999fcde6f381f2c932a1639702a4b6f95a9c9c
7
- data.tar.gz: eb179f0ed0f60a9f70cf59f560c04a6ba3f372396ba19b5f4c7e9a35d05c3ad79d1b86eee25f06918488551767d3c4b734b216005bc7ebe694cfa5651aca6127
6
+ metadata.gz: f4b57b5fa841290a1356cd8faca19f9b1591aae7e91952661200605f75c323876308e42f7fa599f765dc8a2af34a6b08f7f6720e0a973de726ccbe615136bf70
7
+ data.tar.gz: b6ed8c0f548a61a18dc10b1c493b7e18fa97cfa3b98d94da4b8ebfa7f0c467a95d46db7f418032a1f424b52b3a191272c522e9ae234e053760ec51cb6ab95713
data/.gitignore CHANGED
@@ -20,3 +20,5 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  mkmf.log
23
+
24
+ .ruby-version
data/README.md CHANGED
@@ -50,3 +50,41 @@ with the new AMI ID after a deployment. It no longer needs to update your
50
50
  AutoScale group or mess around with network settings, instance sizes, etc., as
51
51
  that information is all contained within the launch template. Failure to use a
52
52
  launch template will result in a `Elbas::Errors::NoLaunchTemplate` error.
53
+
54
+ ### Customizing Server Properties
55
+
56
+ You can pass a block to `autoscale` and return properties for any specific server.
57
+ The block accepts the server and the server's index as arguments.
58
+
59
+ For example, if you want to apply the `:db` role to only the first server:
60
+
61
+ ```ruby
62
+ autoscale 'my-autoscale-group', roles: [:app, :web] do |server, i|
63
+ { roles: [:app, :web, :db] } if i == 0
64
+ end
65
+ ```
66
+
67
+ Returning `nil` from this block will cause the server to use the properties
68
+ passed to `autoscale`.
69
+
70
+ Returning anything but `nil` will override the entire properties hash (as
71
+ opposed to merging the two hashes together).
72
+
73
+ ### Listing Servers
74
+
75
+ You may need to SSH into your servers while debugging deployed code, and
76
+ not everyone has a jumpbox on a basic AutoScaling setup. ELBAS provides a command
77
+ that will list the `ssh` command necessary to connect to each server in any given
78
+ environment:
79
+
80
+ ```
81
+ cap production elbas:ssh
82
+ ```
83
+
84
+ Output will be something like:
85
+
86
+ ```
87
+ [ELBAS] Adding server: ec2-12-34-567-890.compute-1.amazonaws.com
88
+ [ELBAS] SSH commands:
89
+ [ELBAS] 1) ssh deploy@ec2-12-34-567-890.compute-1.amazonaws.com
90
+ ```
data/elbas.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_development_dependency 'bundler', '~> 1.6'
21
+ spec.add_development_dependency 'bundler'
22
22
  spec.add_development_dependency 'byebug'
23
23
  spec.add_development_dependency 'rake'
24
24
  spec.add_development_dependency 'rspec'
@@ -27,7 +27,5 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_dependency 'aws-sdk-autoscaling', '~> 1'
29
29
  spec.add_dependency 'aws-sdk-ec2', '~> 1'
30
-
31
- spec.add_dependency 'capistrano', '> 3.0.0'
32
- spec.add_dependency 'activesupport', '>= 4.0.0'
30
+ spec.add_dependency 'capistrano', '> 3'
33
31
  end
data/lib/elbas/logger.rb CHANGED
@@ -8,8 +8,13 @@ module Elbas
8
8
  $stdout.puts [prefix, message, "\n"].join
9
9
  end
10
10
 
11
- def prefix
12
- @prefix ||= color.colorize("[ELBAS] ", :cyan)
11
+ def cyan(text)
12
+ color.colorize text, :cyan
13
13
  end
14
+
15
+ private
16
+ def prefix
17
+ @prefix ||= cyan('[ELBAS] ')
18
+ end
14
19
  end
15
- end
20
+ end
@@ -2,6 +2,15 @@ require 'elbas'
2
2
  include Elbas::Logger
3
3
 
4
4
  namespace :elbas do
5
+ task :ssh do
6
+ include Capistrano::DSL
7
+
8
+ info "SSH commands:"
9
+ env.servers.to_a.each.with_index do |server, i|
10
+ info " #{i + 1}) ssh #{fetch(:user)}@#{server.hostname}"
11
+ end
12
+ end
13
+
5
14
  task :deploy do
6
15
  asg = Elbas::AWS::AutoscaleGroup.new fetch(:aws_autoscale_group_name)
7
16
 
@@ -23,4 +32,4 @@ namespace :elbas do
23
32
 
24
33
  info "Deployment complete!"
25
34
  end
26
- end
35
+ end
data/lib/elbas/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Elbas
2
- VERSION = '3.0.2'.freeze
2
+ VERSION = '3.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elbas
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logan Serman
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.6'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.6'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -128,28 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - ">"
130
130
  - !ruby/object:Gem::Version
131
- version: 3.0.0
131
+ version: '3'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">"
137
137
  - !ruby/object:Gem::Version
138
- version: 3.0.0
139
- - !ruby/object:Gem::Dependency
140
- name: activesupport
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: 4.0.0
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: 4.0.0
138
+ version: '3'
153
139
  description: Capistrano plugin for deploying to AWS AutoScale Groups.
154
140
  email:
155
141
  - loganserman@gmail.com