Skip to content

Commit

Permalink
Sync contents with other repos
Browse files Browse the repository at this point in the history
  • Loading branch information
tas50 committed May 17, 2015
1 parent 3702aff commit 9b9cf86
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 37 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rvm:
- 1.9.3
- 2.0
- 2.1
- 2.2
notifications:
email:
recipients:
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
#### 0.0.1.alpha.1
#Change Log
This project adheres to [Semantic Versioning](http://semver.org/).

This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)

## Unreleased][unreleased]

1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in sensu-plugins-snmp.gemspec
gemspec
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015 devops@yieldbot.com
Copyright (c) 2015 Sensu-Plugins

MIT License

Expand Down
24 changes: 20 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'yard'
require 'github/markup'
require 'rubocop/rake_task'
require 'github/markup'
require 'redcarpet'
require 'yard'
require 'yard/rake/yardoc_task'

desc 'Don\'t run Rubocop for unsupported versions'
Expand All @@ -18,7 +18,7 @@ end
YARD::Rake::YardocTask.new do |t|
OTHER_PATHS = %w()
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,CONTRIBUTING.md)
end

RuboCop::RakeTask.new
Expand All @@ -29,7 +29,23 @@ end

desc 'Make all plugins executable'
task :make_bin_executable do
`chmod -R +x bin/***/*.rb`
`chmod -R +x bin/*`
end

desc 'Retrieve the current version'
task :version do
puts SensuPluginsSnmp::Version.json_version
end

desc 'Bump the PATCH version'
task :bump do
version_file = 'lib/sensu-plugins-snmp/version.rb'

# Read the file, bump the PATCH version
contents = File.read(version_file).gsub(/(PATCH = )(\d+)/) { |_| Regexp.last_match[1] + (Regexp.last_match[2].to_i + 1).to_s }

# Write the new contents of the file
File.open(version_file, 'w') { |file| file.puts contents }
end

task default: args
126 changes: 106 additions & 20 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,117 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

require 'json'

VAGRANTFILE_API_VERSION = '2'

# Read in the configuration file for the vagrant environment
config_file = JSON.parse(File.read('../GIR/config/vagrant_config.json'))
vagrant_config = config_file['config']

# The vagrant boxes are provisioned by Chef.
# If this is nothing something you want to deal with then comment out the
# provisioner and chef and berkshelf lines. The boxes as they stand are
# fairly barebones but should contain enough for basic development and
# initial testing.
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'chef/centos-6.6'
# Standard configuration details
config.vm.box_download_checksum = true
config.vm.box_download_checksum_type = 'md5'
config.vm.hostname = 'sensu-plugins-dev'

script = <<EOF
sudo yum update -y
sudo yum groupinstall -y development
sudo yum install -y vim nano
#sudo yum install -y ImagicMagic ImageMagick-devel mysql-devel # needed for bundle install
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
curl -L get.rvm.io | bash -s stable
source /home/vagrant/.rvm/scripts/rvm
rvm reload
#rvm install 1.9.3
rvm install 2.1.4
#rvm install 2.0.0
#rvm use 1.9.3@sensu_plugins --create
#rvm use 2.0.0@sensu_plugins --create
rvm use 2.1.4@sensu_plugins --create
rvm use 2.1.4@sensu_plugins --default
EOF

config.vm.provision 'shell', inline: script, privileged: false
# None of the boxes have the chef-client installed,
# this will install the latest version for provisioning
config.omnibus.chef_version = :latest

# Local Berkself configuration
# This is used only if you add recipes to the boxes below.
# All dependencies and such for the roles is done with a Berksfile
# in GIR
config.berkshelf.enabled = true

# Box definitions
# The roles and boxes can be found in the above configuration file
# in GIR. If you want to change them you can do so below but any
# lasting changes should be made against GIR unless they are repo specific
config.vm.define 'cent5' do |cent5|
cent5.vm.box = vagrant_config['cent5']['box']
cent5.vm.provision 'chef_zero' do |chef|
chef.roles_path = vagrant_config['cent5']['role_path']
vagrant_config['cent5']['role'].each do |r|
chef.add_role(r)
end
# chef.add_recipe 'apache2'
end
end

config.vm.define 'cent6' do |cent6|
cent6.vm.box = vagrant_config['cent6']['box']
cent6.vm.provision 'chef_zero' do |chef|
chef.roles_path = vagrant_config['cent6']['role_path']
vagrant_config['cent6']['role'].each do |r|
chef.add_role(r)
end
end
end

config.vm.define 'cent7' do |cent7|
cent7.vm.box = vagrant_config['cent7']['box']
cent7.vm.provision 'chef_zero' do |chef|
chef.roles_path = vagrant_config['cent7']['role_path']
vagrant_config['cent7']['role'].each do |r|
chef.add_role(r)
end
end
end

config.vm.define 'ubuntu14' do |ubuntu14|
ubuntu14.vm.box = vagrant_config['ubuntu14']['box']
ubuntu14.vm.provision 'chef_zero' do |chef|
chef.roles_path = vagrant_config['ubuntu14']['role_path']
vagrant_config['ubuntu14']['role'].each do |r|
chef.add_role(r)
end
end
end

# The bsd boxes have to be configured differently and require some
# tough love. Shared folders are not available and using NFS will
# likely error due to filename length. You can patch it and use
# NFS if you really want but that is not supported or reccomended
# at this time
#
# This means that when making changes to GIR you will need to do a reload
# or possibly a halt/up on the machine to pull in the latest roles and recipes
config.vm.define 'freebsd92' do |bsd9|
bsd9.vm.guest = :freebsd
# The below line is needed for < freebsd9x only
bsd9.ssh.shell = '/bin/sh'
bsd9.vm.box = vagrant_config['bsd9']['box']

# Use rsync in place of shared folders
bsd9.vm.synced_folder '.', '/vagrant', type: 'rsync'
bsd9.vm.provision 'chef_zero' do |chef|
chef.synced_folder_type = 'rsync'
chef.roles_path = vagrant_config['bsd9']['role_path']
vagrant_config['bsd9']['role'].each do |r|
chef.add_role(r)
end
end
end

config.vm.define 'freebsd10' do |bsd10|
bsd10.vm.guest = :freebsd
bsd10.vm.box = vagrant_config['bsd10']['box']

# Use rsync in place of shared folders
bsd10.vm.synced_folder '.', '/vagrant', type: 'rsync'
bsd10.vm.provision 'chef_zero' do |chef|
chef.synced_folder_type = 'rsync'
chef.roles_path = vagrant_config['bsd10']['role_path']
vagrant_config['bsd10']['role'].each do |r|
chef.add_role(r)
end
end
end
end
22 changes: 11 additions & 11 deletions sensu-plugins-snmp.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ end
pvt_key = '~/.ssh/gem-private_key.pem'

Gem::Specification.new do |s|
s.authors = ['Sensu-Plugins and contributors']
s.name = 'sensu-plugins-snmp'
s.version = SensuPluginsSnmp::VERSION
s.authors = ['Yieldbot, Inc. and contributors']
s.email = '<sensu-users@googlegroups.com>'
s.homepage = 'https://github.com/sensu-plugins/sensu-plugins-snmp'
s.summary = ''
Expand All @@ -30,15 +30,15 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.required_ruby_version = '>= 1.9.3'

s.add_runtime_dependency 'sensu-plugin'
s.add_runtime_dependency 'sensu-plugin', '1.1.0'

s.add_development_dependency 'codeclimate-test-reporter'
s.add_development_dependency 'rubocop', '~> 0.30'
s.add_development_dependency 'rspec', '~> 3.1'
s.add_development_dependency 'bundler', '~> 1.7'
s.add_development_dependency 'rake', '~> 10.0'
s.add_development_dependency 'github-markup'
s.add_development_dependency 'redcarpet'
s.add_development_dependency 'yard'
s.add_development_dependency 'pry'
s.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
s.add_development_dependency 'rubocop', '~> 0.30'
s.add_development_dependency 'rspec', '~> 3.1'
s.add_development_dependency 'bundler', '~> 1.7'
s.add_development_dependency 'rake', '~> 10.0'
s.add_development_dependency 'github-markup', '~> 1.3'
s.add_development_dependency 'redcarpet', '~> 3.2'
s.add_development_dependency 'yard', '~> 0.8'
s.add_development_dependency 'pry', '~> 0.10'
end

0 comments on commit 9b9cf86

Please sign in to comment.