capistrano-graphite 0.1.2 → 0.2.0

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: b3064da706a0c929279ccdb160222bdb763a6de2
4
- data.tar.gz: 2fa7efd27c5dfdd3f6a1ac66d324444b7d53b1df
3
+ metadata.gz: 512c233bfce7e7036369cb49ecb2d46213bd649f
4
+ data.tar.gz: 6c3f94242c0c73749664c5b0eee45e0488a01d17
5
5
  SHA512:
6
- metadata.gz: aa2d1b97f587fbb3c2cb68e6a204afc966debecbf3b2d07d885d8c632e0895c94969055445f33a0a02b141e26bd53ae81579153afd4e901e694438b4bc18374d
7
- data.tar.gz: 230e3deb13c40f8ebc9f630519332be8a87b49e541cb7f0c0178335a401e878a11baccf52b11c814397ac9ffff695353b2088896ec4b374bfad26883b4e33256
6
+ metadata.gz: c38dfb78e037082feabc4b35e81d2885b9eabf6f6f858527f4d1dbf3c3f7e5ad5f3dd2ad65a9c834d247843dcbbd8a7aa83cb2c174f90ddfc437c5d86f6a6168
7
+ data.tar.gz: 9c82781ebabcdf39ef5807ba2cf634a94dff97984009fb4874c3f964aac1bd5616bcb211aca24065abf72b246486f55eccb0b4b37e1bd60d988f47e945836138
data/README.md CHANGED
@@ -35,13 +35,13 @@ Add the following line to your ```Capfile```.
35
35
  require "capistrano/graphite"
36
36
 
37
37
  ### Configurable options
38
- Path to your graphite instance
38
+ Path to your graphite instance. Port and user:password are optional.
39
39
 
40
- set :graphite_url, "http://example.com:8000/events/" # The port distinction is optional
40
+ set: :graphite_url, "http://user:password@example.com:8000/events/"
41
41
 
42
42
  Disable sending events for a particular stage by setting the following to 0
43
43
 
44
- set :graphite_enable_events, 0 # This is set to 1 by default
44
+ set :graphite_enable_events, 0 # This is set to 1 by default
45
45
 
46
46
  ### Test that it's working
47
47
  You can run the following on it's own assuming you have configured the graphite url
@@ -11,8 +11,8 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = %q{A gem for pushing graphite events via capistrano v3
12
12
  deployment}
13
13
  spec.description = %q{This gem plugs into the deploy task in capistrano to
14
- help provide visibility to when deployments were
15
- deployed.}
14
+ help provide visibility into when deployments and
15
+ rollbacks occured.}
16
16
  spec.homepage = "https://github.com/scottsuch/capistrano-graphite"
17
17
  spec.license = "MIT"
18
18
 
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Graphite
3
- VERSION = "0.1.2"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -14,14 +14,18 @@ class GraphiteInterface
14
14
  else
15
15
  warn "Not sending an event: graphite_enable_events was assigned an "\
16
16
  "invalid value."
17
- return
17
+ return 0
18
18
  end
19
19
  end
20
20
 
21
21
  def self.post_event(action)
22
22
  uri = URI::parse("#{fetch(:graphite_url)}")
23
- Net::HTTP.start(uri.host, uri.port) do |http|
24
- http.post(uri.path, "{\"what\": \"#{action} #{fetch(:application)} in #{fetch(:stage)}\", \"tags\": \"#{fetch(:application)},#{fetch(:stage)},#{release_timestamp},#{action}\", \"data\": \"#{fetch(:local_user)}\"}")
23
+ req = Net::HTTP::Post.new(uri.path)
24
+ req.basic_auth(uri.user, uri.password) if uri.user
25
+ req.body = "{\"what\": \"#{action} #{fetch(:application)} in #{fetch(:stage)}\", \"tags\": \"#{fetch(:application)},#{fetch(:stage)},#{release_timestamp},#{action}\", \"data\": \"#{fetch(:local_user)}\"}"
26
+
27
+ Net::HTTP.start(uri.host, uri.port) do |http|
28
+ http.request(req)
25
29
  end
26
30
  end
27
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-graphite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - scottsuch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-23 00:00:00.000000000 Z
11
+ date: 2014-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -54,8 +54,8 @@ dependencies:
54
54
  version: '0'
55
55
  description: |-
56
56
  This gem plugs into the deploy task in capistrano to
57
- help provide visibility to when deployments were
58
- deployed.
57
+ help provide visibility into when deployments and
58
+ rollbacks occured.
59
59
  email:
60
60
  - sgorsuch@gmail.com
61
61
  executables: []