toquen 0.1.8 → 0.1.9

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: 1e8eed0f302dd92f603bd71621d6849f55c9ba9a
4
- data.tar.gz: c3ef1e77013f5791903d47ed37c7c4e9969151bd
3
+ metadata.gz: f4898328afa8282ce9598ca1aad43ac4604bd416
4
+ data.tar.gz: ecdab549c9ac27456733f248d9c1af9b375cb6e9
5
5
  SHA512:
6
- metadata.gz: 61b28d8039fc62c554118dc1efc72fbca653728f4dafdef33769f2b88913c5bcf5cb8caebfcdadd07fda304397b8550e50540d855157bae1218c460bd86a96d6
7
- data.tar.gz: 93fa073b84943afd345d1671a6da4550969d7be32abbafd6f79123e2b4b0ad209f950b20c29c9f96acc708e14c1de913dceffa4423cafe4c6115447b6dab3ba9
6
+ metadata.gz: 90c4bcf4c1d15d72aa98442840be6687f755647eed46bf83ec5663ceaa14741c72fd297c354eec34d03492727d50a231c121c2f3027117da5988e28feeb85cb4
7
+ data.tar.gz: 708639a30d3457121cfa55adda961d8df0ff52e361dc7e2f19486e22fe4b7b2a782354958ca81dd56ec54a7d0cc225b5d71d1c2cbd3aeb85299cb1a8aa866124
data/README.md CHANGED
@@ -169,6 +169,29 @@ This happens on every cook, and can be run separately as:
169
169
  cap <role name> update_appconfig
170
170
  ```
171
171
 
172
+ ## External Capistrano Integration
173
+ If you have applications that are deployed via capistrano, you can use Toquen to dynamically configure where these applications are deployed based on their roles. This way, you don't have to keep editing your *config/deploy/production.rb* file every time a server is added or removed.
174
+
175
+ For example, let's say we have an application that should be deployed to all servers with a role of "web". A *config/deploy/production.rb* file could look like this:
176
+
177
+ ```ruby
178
+ require 'toquen'
179
+
180
+ set :aws_access_key_id, "AKEYAKEY"
181
+ set :aws_secret_access_key, "AKEYID"
182
+ set :aws_regions, ['us-east-1']
183
+
184
+ Toquen.servers_with_role('web').each do | details|
185
+ server details[:external_ip], roles: %w{web app db}
186
+ end
187
+
188
+ set :applicationdir, "/home/deploy/webapp"
189
+ set :rails_env, "production"
190
+ set :branch, 'master'
191
+ ...
192
+ ```
193
+
194
+ Just make sure to add the toquen gem to your Gemfile, and then you can use capistrano per usual to deploy.
172
195
 
173
196
  ## Additional Cap Tasks
174
197
  There are a few other helper cap tasks as well - to see them, run:
data/lib/toquen/aws.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  require 'aws'
2
2
 
3
3
  module Toquen
4
+ def self.servers_with_role(role)
5
+ Toquen::AWSProxy.new.server_details.select do |details|
6
+ details[:roles].include? role
7
+ end
8
+ end
9
+
4
10
  class AWSProxy
5
11
  attr_reader :regions
6
12
 
@@ -1,3 +1,3 @@
1
1
  module Toquen
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
data/toquen.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
- gem.add_dependency('capistrano', '~> 3.0.1')
19
+ gem.add_dependency('capistrano', '>= 3.0.1')
20
20
  gem.add_dependency('aws-sdk')
21
21
  gem.add_dependency('terminal-table')
22
22
  gem.add_dependency('term-ansicolor')
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toquen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Muller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-04 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.0.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.0.1
27
27
  - !ruby/object:Gem::Dependency