chef-handler-jenkins_notifier 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b599050804af5bebd29b572bd7573eb792f90d6
4
- data.tar.gz: bf1e0d85d5269f1627d594050b3860ef8d9c01b8
3
+ metadata.gz: e06fcaef34763c3414dc73572d417f2d2a23f32b
4
+ data.tar.gz: e9bd517171f7689f01c354a973aa875cf4b33f86
5
5
  SHA512:
6
- metadata.gz: 2e418d48ed82d8697bfb8bcb5cc9696cc26e1feb9446073ccacd6d6b36c5a0260dbcaabc27f5e59af4d33c7a6285c42be39fc2bde445bdeb49f56f54581887ac
7
- data.tar.gz: 82d94d0877ac90bcd44b51dda3922444b2892b42ddcfc187a299f758966b9e76e9e322de12d171057eae131a03a12b2c8b4b193af5c2a30a310d8b5418a195cc
6
+ metadata.gz: 89c5d192f571d8c340dc10ac7aba314cb86881ae632dda0976102d4097986f4d00f0783c81c2d766f40b0cae3cc2666d3fd8670a405f7d24faf7d4a277d5d838
7
+ data.tar.gz: d7a79c514b3524dff0d9b22f4c57f89ca327adeeda9b7f23b88856f0b8400069e883d204ac283a2e3707ccc4e95ac913c2c308a982f913b62381b3d5301b0cce
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Chef::Handler::JenkinsNotifier
2
2
 
3
- The chef-handler-jenkins_notifier gem is a Chef report mechanism that sends
4
- failures to a Jenkins Job.
3
+ The chef-handler-jenkins_notifier gem is a Chef report mechanism that sends failures to a Jenkins External Job.
5
4
 
6
5
  ## Installation
7
6
 
@@ -21,7 +20,7 @@ Or install it yourself as:
21
20
 
22
21
  ### Create Jenkins Job
23
22
 
24
- Create a Jenkins job.
23
+ Create a Jenkins [external job](https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+external+jobs).
25
24
 
26
25
  ### Create recipe
27
26
 
@@ -1,6 +1,7 @@
1
- require "chef/handler/jenkins_notifier/version"
2
- require "chef/log"
3
- require "net/http"
1
+ require 'chef/handler/jenkins_notifier/version'
2
+ require 'chef/log'
3
+ require 'net/http'
4
+ require 'net/https'
4
5
  require 'digest/md5'
5
6
 
6
7
  class Chef
@@ -41,15 +42,22 @@ class Chef
41
42
  end
42
43
 
43
44
  def submit_jenkins(run_status, log, result)
45
+ #
44
46
  binlog = log.unpack("H*").first
45
47
  ms = (run_status.elapsed_time * 1000).round
46
48
  data = "<run><log encoding='hexBinary'>#{binlog}</log><result>#{result}</result><duration>#{ms}</duration></run>"
49
+ #
50
+ http = Net::HTTP.new(@config[:host], @config[:port])
51
+ if @config[:ssl]
52
+ http.use_ssl = true
53
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
54
+ end
47
55
  req = Net::HTTP::Post.new(@config[:path])
48
56
  if @config[:user] && @config[:pass]
49
57
  req.basic_auth @config[:user], @config[:pass]
50
58
  end
51
59
  req.set_body_internal(data)
52
- res = Net::HTTP.new(@config[:host],@config[:port]).start {|http| http.request(req)}
60
+ res = http.request(req)
53
61
  end
54
62
  end
55
63
  end
@@ -1,7 +1,7 @@
1
1
  class Chef
2
2
  class Handler
3
3
  module JenkinsNotifier
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-handler-jenkins_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yohei Kawahara(inokappa)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-13 00:00:00.000000000 Z
11
+ date: 2015-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler