README.md in capistrano3-consul-0.2.0 vs README.md in capistrano3-consul-0.3.0
- old
+ new
@@ -1,11 +1,9 @@
# Capistrano::Consul
-Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/capistrano/consul`. To experiment with that code, run `bin/console` for an interactive prompt.
+Allows capistrano to obtain the list of servers using a consul server
-TODO: Delete this and the text above, and describe your gem
-
## Installation
Add this line to your application's Gemfile:
```ruby
@@ -20,11 +18,40 @@
$ gem install capistrano-consul
## Usage
-TODO: Write usage instructions here
+In capistrano.
+```ruby
+require 'capistrano/consul'
+```
+
+In your code, then you can map a consul service to roles in capistrano
+```ruby
+consul_service 'app_server', roles %w{web app}
+```
+
+Also, you can use #consul_all_nodes to refer to every node in consul (useful for some tasks)
+
+```ruby
+consul_all_nodes roles %w{web app}
+```
+
+## Configuration
+**consul_url** The api endpoint
+**consul_ssh_gateway** You can configure an ssh gateway (i.e. a tunner that will be created before connecting to consul).
+
+Example:
+``` ruby
+set :consul_url, 'http://localhost:8500'
+set :consul_ssh_gateway, {
+ host: your.gateway.server,
+ user: ENV['USER'],
+ port: 8500, (this port will be used for tunneling)
+ options: {ssh options here}
+ }
+```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).