Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for bonsai #16

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
958bd02
Create .bonsai.yml
Feb 7, 2020
3858794
Update CHANGELOG.md
Feb 7, 2020
5a19e3a
Update version.rb
Feb 7, 2020
5b97e42
Update sensu-plugins-ftp.gemspec
Feb 7, 2020
16ab038
Update .travis.yml
Feb 7, 2020
ffadf1d
Update sensu-plugins-ftp.gemspec
Feb 7, 2020
d083fb3
Update .travis.yml
Feb 7, 2020
99c2503
Update sensu-plugins-ftp.gemspec
Feb 7, 2020
89806ff
Update Rakefile
Feb 7, 2020
005d2ce
Update Rakefile
Feb 7, 2020
9c4f7f5
Update .rubocop.yml
Feb 7, 2020
a9cef63
Update .rubocop.yml
Feb 7, 2020
db0bd28
Update Rakefile
Feb 7, 2020
61a61ca
Update Rakefile
Feb 7, 2020
5b19216
Update Gemfile
Feb 7, 2020
f0f91f2
Update sensu-plugins-ftp.gemspec
Feb 7, 2020
c5b7ca7
Update sensu-plugins-ftp.rb
Feb 7, 2020
9b16f76
Update version.rb
Feb 7, 2020
2ffa66b
Update check-ftp.rb
Feb 7, 2020
d5835e4
Update spec_helper.rb
Feb 7, 2020
88a7877
Update check-ftp.rb
Feb 7, 2020
b7b59eb
Update check-ftp.rb
Feb 7, 2020
d7fc19e
Update spec_helper.rb
Feb 7, 2020
3f2bc19
Update .rubocop.yml
Feb 7, 2020
2aa5b96
Update .travis.yml
Feb 7, 2020
e2059db
Merge pull request #1 from dhpowrhost/feature
Feb 7, 2020
74178e4
Update .travis.yml
Feb 7, 2020
ae21f0b
Merge pull request #2 from dhpowrhost/feature
Feb 7, 2020
e7ea388
Update .travis.yml
Feb 7, 2020
ad78d63
Merge pull request #3 from dhpowrhost/feature
Feb 7, 2020
90f011a
Update .bonsai.yml
Feb 7, 2020
0e1d07a
Update .bonsai.yml
Feb 7, 2020
b929c7d
Update CHANGELOG.md
Mar 15, 2020
29d4ea4
Update CHANGELOG.md
Mar 15, 2020
49520b4
Update version.rb
Mar 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .bonsai.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
description: "#{repo}"
builds:
- 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'"
- "entity.system.platform_version.split('.')[0] == '3'"
- platform: "alpine3.8"
arch: "amd64"
asset_filename: "#{repo}_#{version}_alpine3.8_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform == 'alpine'"
- platform: "centos6"
arch: "amd64"
asset_filename: "#{repo}_#{version}_centos6_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform_family == 'rhel'"
- "entity.system.platform_version.split('.')[0] == '6'"
- platform: "centos7"
arch: "amd64"
asset_filename: "#{repo}_#{version}_centos7_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform_family == 'rhel'"
- "entity.system.platform_version.split('.')[0] == '7'"
- 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_family == 'debian'"
- platform: "debian9"
arch: "amd64"
asset_filename: "#{repo}_#{version}_debian9_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
11 changes: 11 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
AllCops:
TargetRubyVersion: 2.4
Exclude:
- 'bin/check-ftp.rb'

MethodLength:
Max: 200
Expand All @@ -8,6 +12,9 @@ LineLength:
AbcSize:
Max: 100

BlockLength:
Max: 35

FileName:
Enabled: false

Expand All @@ -28,3 +35,7 @@ RegexpLiteral:

Style/Documentation:
Enabled: false

IfUnlessModifier:
Enabled: false

35 changes: 19 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ cache:
install:
- bundle install
rvm:
- 2.0
- 2.1
- 2.2
- 2.3.0
- 2.4.1
notifications:
Expand All @@ -19,17 +16,23 @@ script:
- bundle exec rake default
- gem build sensu-plugins-ftp.gemspec
- gem install sensu-plugins-ftp-*.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
api_key:
secure: v95V8Ti3/Ti38MFl8bYYJLv1M6IQ8XDr4mRbOCc4bsSBQJeR7vxlYqHLlymteDWdS26KkP6TBYJtMtoeGfuEYRRYoTFJNf23Tt75Qo6rGVxBJqjwhMkR+Q5c/3lYS84glryX9suZ17MXE2qOBLOBRsR1D4TemkC/IqysyQ3O6DA=
gem: sensu-plugins-ftp
on:
tags: true
all_branches: true
rvm: 2.0
rvm: 2.1
rvm: 2.2
rvm: 2.3.0
rvm: 2.4.1
repo: sensu-plugins/sensu-plugins-ftp
- provider: script
script: chmod +x bonsai/ruby-runtime/travis-build-ruby-plugin-assets.sh && bonsai/ruby-runtime/travis-build-ruby-plugin-assets.sh sensu-plugins-ftp
skip_cleanup: true
on:
tags: true
all_branches: true
rvm: 2.4.1
- provider: rubygems
github_token: $GH_TOKEN
api_key:
secure: v95V8Ti3/Ti38MFl8bYYJLv1M6IQ8XDr4mRbOCc4bsSBQJeR7vxlYqHLlymteDWdS26KkP6TBYJtMtoeGfuEYRRYoTFJNf23Tt75Qo6rGVxBJqjwhMkR+Q5c/3lYS84glryX9suZ17MXE2qOBLOBRsR1D4TemkC/IqysyQ3O6DA=
gem: sensu-plugins-ftp
on:
tags: true
all_branches: true
rvm: 2.4.1
repo: sensu-plugins/sensu-plugins-ftp
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
### Changed
- update location for our changelog format (@majormoses)

## [1.1.1] - 2020-02-07
denogio marked this conversation as resolved.
Show resolved Hide resolved
### Added
- added .bonsai.yml for bonsai.sensu.io compatibility

## [1.1.0] - 2017-05-30
### Added
- check-ftp.rb: add support for implicit FTPS. (@swibowo)
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gemspec
8 changes: 5 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'bundler/gem_tasks'
require 'github/markup'
require 'redcarpet'
Expand All @@ -7,9 +9,9 @@ require 'yard'
require 'yard/rake/yardoc_task'

YARD::Rake::YardocTask.new do |t|
OTHER_PATHS = %w().freeze
OTHER_PATHS = %w[].freeze
t.files = ['lib/**/*.rb', 'bin/**/*.rb', OTHER_PATHS]
t.options = %w(--markup-provider=redcarpet --markup=markdown --main=README.md --files CHANGELOG.md)
t.options = %w[--markup-provider=redcarpet --markup=markdown --main=README.md --files CHANGELOG.md]
end

RuboCop::RakeTask.new
Expand All @@ -35,4 +37,4 @@ task :check_binstubs do
end
end

task default: [:spec, :make_bin_executable, :yard, :rubocop, :check_binstubs]
task default: %i[spec make_bin_executable yard rubocop check_binstubs]
2 changes: 2 additions & 0 deletions bin/check-ftp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#! /usr/bin/env ruby
# frozen_string_literal: true

#
# check-ftp
#
Expand Down
2 changes: 2 additions & 0 deletions lib/sensu-plugins-ftp.rb
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# frozen_string_literal: true

require 'sensu-plugins-ftp/version'
4 changes: 3 additions & 1 deletion lib/sensu-plugins-ftp/version.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# frozen_string_literal: true

module SensuPluginsFtp
module Version
MAJOR = 1
MINOR = 1
PATCH = 0
denogio marked this conversation as resolved.
Show resolved Hide resolved
PATCH = 1

VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
end
Expand Down
14 changes: 8 additions & 6 deletions sensu-plugins-ftp.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Expand All @@ -11,7 +13,7 @@ Gem::Specification.new do |s|
for monitoring service connectivity'
s.email = '<[email protected]>'
s.executables = Dir.glob('bin/**/*.rb').map { |file| File.basename(file) }
s.files = Dir.glob('{bin,lib}/**/*') + %w(LICENSE README.md CHANGELOG.md)
s.files = Dir.glob('{bin,lib}/**/*') + %w[LICENSE README.md CHANGELOG.md]
s.homepage = 'https://github.com/sensu-plugins/sensu-plugins-ftp'
s.license = 'MIT'
s.metadata = { 'maintainer' => 'sensu-plugin',
Expand All @@ -29,15 +31,15 @@ Gem::Specification.new do |s|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
s.version = SensuPluginsFtp::Version::VER_STRING

s.add_runtime_dependency 'sensu-plugin', '~> 1.2'
s.add_runtime_dependency 'sensu-plugin', '>= 4.0', '<5.0'
s.add_runtime_dependency 'double-bag-ftps', '~> 0.1.3'

s.add_development_dependency 'bundler', '~> 1.7'
s.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
s.add_development_dependency 'bundler', '~> 2.1'
s.add_development_dependency 'codeclimate-test-reporter', '~> 1.0'
s.add_development_dependency 'github-markup', '~> 3.0'
s.add_development_dependency 'pry', '~> 0.10'
s.add_development_dependency 'rubocop', '~> 0.40.0'
s.add_development_dependency 'rspec', '~> 3.1'
s.add_development_dependency 'rubocop', '~> 0.50.0'
s.add_development_dependency 'rspec', '~> 3.4'
s.add_development_dependency 'rake', '~> 12.3'
s.add_development_dependency 'redcarpet', '~> 3.2'
s.add_development_dependency 'yard', '~> 0.8'
Expand Down
2 changes: 2 additions & 0 deletions test/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start