From a0c4f16a9a7d7d406069525d505df2f34768083f Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 23 Aug 2018 10:05:04 -0800 Subject: [PATCH 1/3] change requirement to ruby >= 2.0 --- sensu-plugins-cpu-checks.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensu-plugins-cpu-checks.gemspec b/sensu-plugins-cpu-checks.gemspec index d03be7f..46f9552 100644 --- a/sensu-plugins-cpu-checks.gemspec +++ b/sensu-plugins-cpu-checks.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength s.platform = Gem::Platform::RUBY s.post_install_message = 'You can use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu' s.require_paths = ['lib'] - s.required_ruby_version = '>= 2.1' + s.required_ruby_version = '>= 2.0' # s.signing_key = File.expand_path(pvt_key) if $PROGRAM_NAME =~ /gem\z/ s.summary = 'Sensu plugins for cpu checks and metrics' s.test_files = s.files.grep(%r{^(test|spec|features)/}) From 6093ca4a40fece02c863d7e8f40a6b140ed636a7 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Wed, 17 Apr 2019 11:39:50 -0800 Subject: [PATCH 2/3] resync with upstream --- sensu-plugins-cpu-checks.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensu-plugins-cpu-checks.gemspec b/sensu-plugins-cpu-checks.gemspec index 1086bff..fdb11ce 100644 --- a/sensu-plugins-cpu-checks.gemspec +++ b/sensu-plugins-cpu-checks.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength s.platform = Gem::Platform::RUBY s.post_install_message = 'You can use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu' s.require_paths = ['lib'] - s.required_ruby_version = '>= 2.0' + s.required_ruby_version = '>= 2.1' # s.signing_key = File.expand_path(pvt_key) if $PROGRAM_NAME =~ /gem\z/ s.summary = 'Sensu plugins for cpu checks and metrics' s.test_files = s.files.grep(%r{^(test|spec|features)/}) From 189101bacba342e6cdfc1a46a20261703cc3d5b4 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Wed, 17 Apr 2019 11:54:06 -0800 Subject: [PATCH 3/3] prepping for Bonsai Asset --- .bonsai.yml | 28 ++++++++++++++++++++++++++++ .travis.yml | 15 ++++++++++++--- CHANGELOG.md | 7 +++++++ README.md | 5 +++++ sensu-plugins-cpu-checks.gemspec | 4 ++-- 5 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 .bonsai.yml diff --git a/.bonsai.yml b/.bonsai.yml new file mode 100644 index 0000000..4424e50 --- /dev/null +++ b/.bonsai.yml @@ -0,0 +1,28 @@ +--- +description: "#{repo}" +builds: +- platform: "debian" + arch: "amd64" + asset_filename: "#{repo}_#{version}_debian_linux_amd64.tar.gz" + sha_filename: "#{repo}_#{version}_sha512-checksums.txt" + filter: + - "entity.system.os == 'linux'" + - "entity.system.arch == 'amd64'" + - "entity.system.platform == 'debian'" +- platform: "centos" + arch: "amd64" + asset_filename: "#{repo}_#{version}_centos_linux_amd64.tar.gz" + sha_filename: "#{repo}_#{version}_sha512-checksums.txt" + filter: + - "entity.system.os == 'linux'" + - "entity.system.arch == 'amd64'" + - "entity.system.platform == 'rhel'" +- platform: "alpine" + arch: "amd64" + asset_filename: "#{repo}_#{version}_alpine_linux_amd64.tar.gz" + sha_filename: "#{repo}_#{version}_sha512-checksums.txt" + filter: + - "entity.system.os == 'linux'" + - "entity.system.arch == 'amd64'" + - "entity.system.platform == 'alpine'" + diff --git a/.travis.yml b/.travis.yml index 4f82d43..831beb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,11 @@ language: ruby +services: +- docker cache: - bundler install: - bundle install rvm: -- 2.1 -- 2.2 - 2.3.0 - 2.4.1 notifications: @@ -18,8 +18,10 @@ script: - bundle exec rake default - gem build sensu-plugins-cpu-checks.gemspec - gem install sensu-plugins-cpu-checks-*.gem +before_deploy: +- bash -c "[ ! -d bonsai/ ] && git clone https://github.com/sensu/sensu-go-bonsai-asset.git bonsai || echo 'bonsai/ exists, skipping git clone'" deploy: - provider: rubygems +- provider: rubygems api_key: secure: AyvwPx6XOE0hfd09ji2oRonTECC+zh0sVZByRHtCfulKBNKPM5rph96eR6q0QFz9/dqJev7veAThmxGrEaODE4muMk5CdM5VfaR1i8Fc4e7YmuhnMAZxzi9RsBSE/FpPlXVhJ0kd8AP910SVmBixnDyxlC46zatdKToZELv/YF8= gem: sensu-plugins-cpu-checks @@ -28,3 +30,10 @@ deploy: all_branches: true rvm: 2.4.1 repo: sensu-plugins/sensu-plugins-cpu-checks +- provider: script + script: bonsai/ruby-runtime/travis-build-ruby-plugin-assets.sh sensu-plugins-cpu-checks + skip_cleanup: true + on: + tags: true + all_branches: true + rvm: 2.4.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index f8dec0a..09f59ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ This project adheres to [Semantic Versioning](http://semver.org/). This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md) ## [Unreleased] +### Breaking Changes +- Update minimum required ruby version to 2.3. Drop unsupported ruby versions. +- Bump `sensu-plugin` dependency from `~> 1.2` to `~> 4.0` you can read the changelog entries for [4.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#400---2018-02-17), [3.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#300---2018-12-04), and [2.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#v200---2017-03-29) + +### Added +- Travis build automation to generate Sensu Asset tarballs that can be used n conjunction with Sensu provided ruby runtime assets and the Bonsai Asset Index +- Require latest sensu-plugin for [Sensu Go support](https://github.com/sensu-plugins/sensu-plugin#sensu-go-enablement) ## [3.0.0] - 2018-07-24 ### Breaking Changes diff --git a/README.md b/README.md index 93bb848..7d12927 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@ [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-cpu-checks/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-cpu-checks) [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-cpu-checks/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-cpu-checks) [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-cpu-checks.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-cpu-checks) +[![Sensu Bonsai Asset](https://img.shields.io/badge/Bonsai-Download%20Me-brightgreen.svg?colorB=89C967&logo=sensu)](https://bonsai.sensu.io/assets/sensu-plugins/sensu-plugins-cpu-checks) + +## Sensu Asset + The Sensu assets packaged from this repository are built against the Sensu ruby runtime environment. When using these assets as part of a Sensu Go resource (check, mutator or handler), make sure you include the corresponding Sensu ruby runtime asset in the list of assets needed by the resource. The current ruby-runtime assets can be found [here](https://bonsai.sensu.io/assets/sensu/sensu-ruby-runtime) in the [Bonsai Asset Index](bonsai.sensu.io). ## Functionality @@ -23,3 +27,4 @@ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html) ## Notes +The `check-cpu.sh` shell script in this repository requires the `bc` utility to be installed and available in the executable path. This shell script is not installed when using the Ruby gem or Sensu asset derived from this repository. diff --git a/sensu-plugins-cpu-checks.gemspec b/sensu-plugins-cpu-checks.gemspec index fdb11ce..a678698 100644 --- a/sensu-plugins-cpu-checks.gemspec +++ b/sensu-plugins-cpu-checks.gemspec @@ -25,13 +25,13 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength s.platform = Gem::Platform::RUBY s.post_install_message = 'You can use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu' s.require_paths = ['lib'] - s.required_ruby_version = '>= 2.1' + s.required_ruby_version = '>= 2.3' # s.signing_key = File.expand_path(pvt_key) if $PROGRAM_NAME =~ /gem\z/ s.summary = 'Sensu plugins for cpu checks and metrics' s.test_files = s.files.grep(%r{^(test|spec|features)/}) s.version = SensuPluginsCpuChecks::Version::VER_STRING - s.add_runtime_dependency 'sensu-plugin', '~> 1.2' + s.add_runtime_dependency 'sensu-plugin', '~> 4.0' s.add_runtime_dependency 'linux-kstat', '0.1.3'