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 +4 -4
 - data/README.md +2 -3
 - data/lib/chef/handler/jenkins_notifier.rb +12 -4
 - data/lib/chef/handler/jenkins_notifier/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e06fcaef34763c3414dc73572d417f2d2a23f32b
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e9bd517171f7689f01c354a973aa875cf4b33f86
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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  
     | 
| 
       2 
     | 
    
         
            -
            require  
     | 
| 
       3 
     | 
    
         
            -
            require  
     | 
| 
      
 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 =  
     | 
| 
      
 60 
     | 
    
         
            +
                    res = http.request(req)
         
     | 
| 
       53 
61 
     | 
    
         
             
                  end
         
     | 
| 
       54 
62 
     | 
    
         
             
                end
         
     | 
| 
       55 
63 
     | 
    
         
             
              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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-04-04 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |