sensu-plugins-jenkins 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +1 -1
- data/bin/check-jenkins-build-time.rb +14 -1
- data/bin/check-jenkins-job-status.rb +15 -2
- data/lib/sensu-plugins-jenkins/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: 6adc14f4014cb596e96c71bfdebb2edc8b9d76a9
|
4
|
+
data.tar.gz: 26ef4af295d8f1469130434ecc662ed816ce275c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b52c9b773289d91599ce545449378aa74fae13ed01e04152ef6b71d0370c5b13f688a4ac82d7522a1a498ac85a9825721c025cc42eaec038258052d8415efb3e
|
7
|
+
data.tar.gz: 94a0de3f435e75dc4533aa30ba2c098ba79ad1645a4bcad7e2477c742892d231d2fdc51a5aa2c4e1646280381af3c65b74ee70f57cfe2479c37bf7e9ccf67665
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [1.1.0] - 2016-10-06
|
9
|
+
### Added
|
10
|
+
- Added authentication options to check-jenkins-build-time.rb and check-jenkins-job-status.rb
|
11
|
+
|
8
12
|
## [1.0.0] - 2016-10-04
|
9
13
|
### Added
|
10
14
|
- Ruby 2.3.0 support
|
@@ -47,7 +51,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
47
51
|
### Added
|
48
52
|
- initial release
|
49
53
|
|
50
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.
|
54
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.1.0...HEAD
|
55
|
+
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.0.0...1.1.0
|
51
56
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/0.1.0...1.0.0
|
52
57
|
[0.1.0]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/0.0.5...0.1.0
|
53
58
|
[0.0.5]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/0.0.4...0.0.5
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## Sensu-Plugins-jenkins
|
2
2
|
|
3
|
-
[
|
3
|
+
[![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-jenkins.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-jenkins)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/sensu-plugins-jenkins.svg)](http://badge.fury.io/rb/sensu-plugins-jenkins)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-jenkins/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-jenkins)
|
6
6
|
[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-jenkins/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-jenkins)
|
@@ -50,6 +50,19 @@ class JenkinsBuildTime < Sensu::Plugin::Check::CLI
|
|
50
50
|
long: '--jobs JOB_NAME=TIME_EXPRESSION,[JOB_NAME=TIME_EXPRESSION]',
|
51
51
|
required: true
|
52
52
|
|
53
|
+
option :username,
|
54
|
+
description: 'Username for Jenkins instance',
|
55
|
+
short: '-U USERNAME',
|
56
|
+
long: '--username USERNAME',
|
57
|
+
required: false
|
58
|
+
|
59
|
+
option :password,
|
60
|
+
description: "Password for Jenkins instance. Either set ENV['JENKINS_PASS'] or provide it as an option",
|
61
|
+
short: '-p PASSWORD',
|
62
|
+
long: '--password PASSWORD',
|
63
|
+
required: false,
|
64
|
+
default: ENV['JENKINS_PASS']
|
65
|
+
|
53
66
|
def run
|
54
67
|
@now = Time.now
|
55
68
|
critical_jobs = []
|
@@ -84,7 +97,7 @@ class JenkinsBuildTime < Sensu::Plugin::Check::CLI
|
|
84
97
|
private
|
85
98
|
|
86
99
|
def jenkins
|
87
|
-
@jenkins ||= JenkinsApi::Client.new(server_url: config[:url], log_level: 3)
|
100
|
+
@jenkins ||= JenkinsApi::Client.new(server_url: config[:url], username: config[:username], password: config[:password], log_level: 3)
|
88
101
|
end
|
89
102
|
|
90
103
|
def last_successful_build_number(job_name)
|
@@ -20,7 +20,6 @@
|
|
20
20
|
#
|
21
21
|
# NOTES:
|
22
22
|
# #YELLOW
|
23
|
-
# add authorization options
|
24
23
|
# add url to job's log for CRITICAL state
|
25
24
|
#
|
26
25
|
# LICENSE:
|
@@ -54,6 +53,19 @@ class JenkinsJobChecker < Sensu::Plugin::Check::CLI
|
|
54
53
|
long: '--verbose CLIENT-LOG-LEVEL',
|
55
54
|
default: 3
|
56
55
|
|
56
|
+
option :username,
|
57
|
+
description: 'Username for Jenkins instance',
|
58
|
+
short: '-U USERNAME',
|
59
|
+
long: '--username USERNAME',
|
60
|
+
required: false
|
61
|
+
|
62
|
+
option :password,
|
63
|
+
description: "Password for Jenkins instance. Either set ENV['JENKINS_PASS'] or provide it as an option",
|
64
|
+
short: '-p PASSWORD',
|
65
|
+
long: '--password PASSWORD',
|
66
|
+
required: false,
|
67
|
+
default: ENV['JENKINS_PASS']
|
68
|
+
|
57
69
|
def run
|
58
70
|
if failed_jobs.any?
|
59
71
|
critical "Jobs reporting failure: #{failed_jobs_names}"
|
@@ -67,7 +79,8 @@ class JenkinsJobChecker < Sensu::Plugin::Check::CLI
|
|
67
79
|
def jenkins_api_client
|
68
80
|
@jenkins_api_client ||= JenkinsApi::Client.new(
|
69
81
|
server_url: config[:server_api_url],
|
70
|
-
log_level: config[:client_log_level].to_i
|
82
|
+
log_level: config[:client_log_level].to_i,
|
83
|
+
username: config[:username], password: config[:password]
|
71
84
|
)
|
72
85
|
end
|
73
86
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-jenkins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|