capistrano-consul 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Y2JkMmViNDAzZDFmZGY5NzEyNjkwYzI2NjM0ODg2ZmVkM2RmZGEwNw==
5
+ data.tar.gz: !binary |-
6
+ ZTlhYmI4OGUzMGJjZWNjNzE2ZGRlYzMxOTFmYTllYmQ2MjFkYjBkNQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NDJkOTc4MTkyMWI2YjlkNjgxOGVmY2Q1ZjE2MmIyMzdhYmIzNDM1MmM4NWI3
10
+ NWExMGQ5M2VkYzM0ODEyNDc3ZjQzYmRmNGRiOGI3ODU4MjgwNTgyZGU2MGQx
11
+ NjUxNjAxMmMxMGIwYTU1OWQyOWY3ODM2MzkzOWI4NTUyZDE2ZWY=
12
+ data.tar.gz: !binary |-
13
+ MTQ0ZDgwYWZmNmI3ODE3MmZiMjg1OTIzNWVjMmM0MjViMDFmODA1YWRlMGY0
14
+ NTg5OTVmY2ZmY2ZkZmViZTVjMzRmOTc5MzZjYWE4NGZiMjkxYmUwZGJiOGU5
15
+ MjFmYTJjNTQ4YzhhNTIwYjUzNGJjYmY0NDYzMjg0MTYyZWU0Yjk=
data/.gitignore ADDED
@@ -0,0 +1,35 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /vendor/bundle
26
+ /lib/bundler/man/
27
+
28
+ # for a library or gem, you might want to ignore these files since the code is
29
+ # intended to run in multiple environments; otherwise, check them in:
30
+ # Gemfile.lock
31
+ # .ruby-version
32
+ # .ruby-gemset
33
+
34
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
35
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # capistrano-consul
2
+ Capistrano plugin to populate roles with hosts from consul
@@ -0,0 +1,16 @@
1
+ require File.expand_path('../lib/capistrano/consul/version.rb', __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'capistrano-consul'
5
+ s.version = Capistrano::Consul::VERSION
6
+ s.date = "2015-06-23"
7
+ s.description = "Consul discovery for Capistrano"
8
+ s.summary = "Consul discovery for Capistrano"
9
+ s.authors = ["Ryan Graham"]
10
+ s.email = "ryan.graham@gmail.com"
11
+ s.homepage = "http://github.com/ryangraham/capistrano-consul"
12
+ s.require_paths = ["lib"]
13
+ s.files = `git ls-files`.split("\n")
14
+
15
+ s.add_runtime_dependency "diplomat"
16
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Consul
3
+ VERSION = '0.0.2'
4
+ end
5
+ end
@@ -0,0 +1,33 @@
1
+ require 'capistrano'
2
+ require 'diplomat'
3
+
4
+ unless Capistrano::Configuration.respond_to?(:instance)
5
+ abort 'capistrano-consul requires Capistrano >= 2'
6
+ end
7
+
8
+ module Capistrano
9
+ module Consul
10
+ def self.extend(configuration)
11
+ configuration.load do
12
+ Capistrano::Configuration.instance.load do
13
+
14
+ def service(service_name, *roles)
15
+ Diplomat.configure do |config|
16
+ config.url = fetch(:consul_url)
17
+ # TODO: pass through ssl opts
18
+ end
19
+
20
+ @nodes = Diplomat::Service.get(service_name, :all)
21
+ @nodes.each do |node|
22
+ server node.Address, *roles
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+
31
+ if Capistrano::Configuration.instance
32
+ Capistrano::Consul.extend(Capistrano::Configuration.instance)
33
+ end
@@ -0,0 +1 @@
1
+ require 'capistrano/consul.rb'
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-consul
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Ryan Graham
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: diplomat
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Consul discovery for Capistrano
28
+ email: ryan.graham@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - .gitignore
34
+ - Gemfile
35
+ - README.md
36
+ - capistrano-consul.gemspec
37
+ - lib/capistrano-consul.rb
38
+ - lib/capistrano/consul.rb
39
+ - lib/capistrano/consul/version.rb
40
+ homepage: http://github.com/ryangraham/capistrano-consul
41
+ licenses: []
42
+ metadata: {}
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubyforge_project:
59
+ rubygems_version: 2.4.7
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: Consul discovery for Capistrano
63
+ test_files: []