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 +4 -4
- data/.gitignore +2 -0
- data/README.md +38 -0
- data/elbas.gemspec +2 -4
- data/lib/elbas/logger.rb +8 -3
- data/lib/elbas/tasks/elbas.rake +10 -1
- data/lib/elbas/version.rb +1 -1
- metadata +7 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32639852b7a6af9bce74c3e376c271e4f7847bec72268de2d2f0d9533cea6138
|
4
|
+
data.tar.gz: 5ba3d1d1d1c599ad1c0a4bcc88643db6287e5cca6dad4deb49831a7ce7a36e8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4b57b5fa841290a1356cd8faca19f9b1591aae7e91952661200605f75c323876308e42f7fa599f765dc8a2af34a6b08f7f6720e0a973de726ccbe615136bf70
|
7
|
+
data.tar.gz: b6ed8c0f548a61a18dc10b1c493b7e18fa97cfa3b98d94da4b8ebfa7f0c467a95d46db7f418032a1f424b52b3a191272c522e9ae234e053760ec51cb6ab95713
|
data/.gitignore
CHANGED
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'
|
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
|
12
|
-
|
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
|
data/lib/elbas/tasks/elbas.rake
CHANGED
@@ -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
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.
|
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: '
|
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: '
|
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
|
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
|
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
|