-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chef 12 migration * update for chef 12 * fix verify_version * fix deprecation warning * fix tests for chef 12 * updating filesystem cookbook * updating log spec for 100% coverage * updating ruby-version * updating rake and berks for chef12 * locking berksfile.lock * locking berksfile.lock * putting in apt-compile-time * adding apt to runlist
- Loading branch information
Showing
31 changed files
with
486 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
--- | ||
driver_plugin: vagrant | ||
driver_config: | ||
require_chef_omnibus: '11.18' | ||
customize: | ||
cpus: 1 | ||
memory: 512 | ||
ssh: | ||
insert_key: false | ||
|
||
provisioner: | ||
name: chef_zero | ||
always_update_cookbooks: true | ||
require_chef_omnibus: 12.16.42 | ||
log_level: info | ||
log_file: /var/log/chef-solo.log | ||
|
||
platforms: | ||
- name: centos-7.2 | ||
driver_config: | ||
box: bento/centos-7.2 | ||
- name: centos-6.8 | ||
driver_config: | ||
box: bento/centos-6.8 | ||
- name: ubuntu-12.04 | ||
driver_config: | ||
box: opscode-ubuntu-12.04 | ||
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box | ||
box: bento/ubuntu-12.04 | ||
- name: ubuntu-14.04 | ||
driver_config: | ||
box: opscode-ubuntu-14.04 | ||
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-14.04_provisionerless.box | ||
- name: centos-6.8 | ||
driver_config: | ||
box: opscode-centos-6.8 | ||
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-6.8_provisionerless.box | ||
box: bento/ubuntu-14.04 | ||
|
||
suites: | ||
- name: default | ||
run_list: ["recipe[rs-storage]"] | ||
attributes: {} | ||
run_list: ['recipe[apt]','recipe[rs-storage]'] | ||
attributes: | ||
apt: | ||
compile_time_update: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--format documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
AllCops: | ||
Exclude: | ||
- 'berks-cookbooks/**/*' | ||
- 'knife.rb' | ||
Style/AccessorMethodName: | ||
Exclude: | ||
- 'Rakefile' | ||
- 'libraries/helper.rb' | ||
Lint/UselessAssignment: | ||
Exclude: | ||
- 'recipes/stripe.rb' | ||
- 'recipes/volume.rb' | ||
Style/PredicateName: | ||
Exclude: | ||
- 'libraries/helper.rb' | ||
Lint/EndAlignment: | ||
Exclude: | ||
- 'recipes/default.rb' | ||
Metrics/BlockNesting: | ||
Exclude: | ||
- 'recipes/default.rb' | ||
Style/DoubleNegation: | ||
Exclude: | ||
- 'libraries/helper.rb' | ||
Style/RegexpLiteral: | ||
Exclude: | ||
- 'libraries/helper.rb' | ||
Lint/ShadowingOuterLocalVariable: | ||
Exclude: | ||
- 'recipes/stripe.rb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
language: ruby | ||
rvm: | ||
- 2.0.0 | ||
- 1.9.3 | ||
before_script: bundle exec berks install | ||
script: bundle exec strainer test --except kitchen | ||
- 2.3.1 | ||
before_install: | ||
- curl -L https://www.getchef.com/chef/install.sh | sudo bash -s -- -P chefdk -v 1.0.3 | ||
- gem install bundler -v 1.11.2 | ||
install: | ||
- chef exec bundle install --jobs=3 --retry=3 | ||
before_script: chef exec rake setup_test_environment | ||
script: "./.travis_install.sh" | ||
notifications: | ||
slack: | ||
secure: jypk2i83t2b5e1oAGGV3mcIWGesJYNk1MnH/kDsgClD16pLKfOE8rnyduhwNdNL1NlVURbFMjp9ZEGJQeYqnLs9ZXnr3ez7lDmFoM9YWVE030664tyTmaXYcksQBINfYwMrO13oih8bvXwStLshItxAbNHpKiu4/qmzDVl+rOtE= | ||
secure: FBCQb9ApoEzqZisD4IbFmw+ZujFU6kwRkCiwES6qmJB22cgMsFqBB/+KOv3OLAFTNVjQfsTGEyzeqXFW9Chhze+xOGSxBMKOtZI/+5OVTvNithBhwOBlcb3IW546mlfGMXorWlY6JEb9NO0c1oJ7Oe9wB9WIELaQy6MaF9PS7q0= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
set -ev | ||
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then | ||
git clone https://github.com/$TRAVIS_REPO_SLUG.git $TRAVIS_REPO_SLUG | ||
cd $TRAVIS_REPO_SLUG | ||
git checkout master | ||
git checkout -qf $TRAVIS_COMMIT | ||
fi | ||
chef exec rake except_kitchen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
site :opscode | ||
source 'https://supermarket.chef.io' | ||
|
||
cookbook "rightscale_volume", github: 'rightscale-cookbooks/rightscale_volume' | ||
cookbook "rightscale_backup", github: 'rightscale-cookbooks/rightscale_backup' | ||
cookbook 'windows', '1.40.0'# keep for compatiblity with chef 11, can remove with chef 12 | ||
metadata | ||
|
||
cookbook 'filesystem', github: 'rightscale-cookbooks-contrib/filesystem_cookbook', branch: 'update_lvm_cookbook_dependency_3' | ||
cookbook 'rightscale_volume', github: 'rightscale-cookbooks/rightscale_volume' | ||
cookbook 'rightscale_backup', github: 'rightscale-cookbooks/rightscale_backup' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
DEPENDENCIES | ||
filesystem | ||
git: https://github.com/rightscale-cookbooks-contrib/filesystem_cookbook.git | ||
revision: 9c2a21a8aa41b16d3774ed5292f9a31b018dee92 | ||
branch: update_lvm_cookbook_dependency_3 | ||
rightscale_backup | ||
git: https://github.com/rightscale-cookbooks/rightscale_backup.git | ||
revision: 454fa9f582943f0ace47dd90bf6106e7bf752a93 | ||
rightscale_volume | ||
git: https://github.com/rightscale-cookbooks/rightscale_volume.git | ||
revision: 48c24ba0f0815e86200793ef50fe27dce9f09d8e | ||
rs-storage | ||
path: . | ||
metadata: true | ||
|
||
GRAPH | ||
apt (5.0.1) | ||
compat_resource (>= 12.16.3) | ||
build-essential (7.0.3) | ||
compat_resource (>= 12.16.3) | ||
mingw (>= 1.1) | ||
seven_zip (>= 0.0.0) | ||
chef_handler (2.1.0) | ||
compat_resource (12.16.3) | ||
filesystem (0.11.0) | ||
lvm (~> 3.1) | ||
xfs (>= 0.0.0) | ||
lvm (3.1.0) | ||
marker (1.0.1) | ||
mingw (1.2.4) | ||
compat_resource (>= 0.0.0) | ||
seven_zip (>= 0.0.0) | ||
ohai (4.2.3) | ||
compat_resource (>= 12.14.7) | ||
rightscale_backup (2.0.0) | ||
build-essential (>= 0.0.0) | ||
rightscale_volume (~> 2.0.0) | ||
rightscale_volume (2.0.0) | ||
build-essential (>= 0.0.0) | ||
rs-storage (2.0.0) | ||
apt (>= 0.0.0) | ||
build-essential (>= 0.0.0) | ||
chef_handler (>= 0.0.0) | ||
filesystem (>= 0.0.0) | ||
lvm (~> 3.1) | ||
marker (>= 0.0.0) | ||
rightscale_backup (~> 2.0.0) | ||
rightscale_volume (~> 2.0.0) | ||
seven_zip (2.0.2) | ||
windows (>= 1.2.2) | ||
windows (2.1.1) | ||
ohai (>= 4.0.0) | ||
xfs (2.0.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,7 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'berkshelf' | ||
gem 'thor-foodcritic' | ||
gem 'rake' | ||
gem 'chef', '~> 12.16' | ||
|
||
group :integration do | ||
gem 'test-kitchen', '~> 1.2.1' | ||
gem 'kitchen-vagrant', '0.15.0' | ||
gem 'strainer', '~> 3.3.0' | ||
gem 'chefspec', '~> 3.4.0' | ||
gem 'travis-lint' | ||
gem 'rspec-expectations', '~> 2.14.0' | ||
gem 'buff-ignore','1.1.1' | ||
gem 'rack', '1.6.4' | ||
gem 'json','~> 1.8.0' | ||
gem 'net-http-persistent', '= 2.9.4' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
require 'rspec/core/rake_task' | ||
require 'foodcritic' | ||
require 'kitchen' | ||
|
||
directory = File.expand_path(File.dirname(__FILE__)) | ||
|
||
desc 'Sets up knife, and vendors cookbooks' | ||
task :setup_test_environment do | ||
File.open('knife.rb', 'w+') do |file| | ||
file.write <<-EOF | ||
log_level :debug | ||
log_location STDOUT | ||
cookbook_path ['.', 'berks-cookbooks/' ] | ||
EOF | ||
end | ||
sh('berks vendor') | ||
end | ||
|
||
desc 'verifies version and changelog' | ||
task :verify_version do | ||
def old_version? | ||
f = `git show master:metadata.rb` | ||
f.each_line do |line| | ||
if line =~ /^version/ | ||
_k, v = line.strip.split | ||
@old_version = v | ||
end | ||
end | ||
@old_version | ||
end | ||
|
||
def new_version? | ||
f = File.read('metadata.rb') | ||
f.each_line do |line| | ||
if line =~ /^version/ | ||
_k, v = line.strip.split | ||
@new_version = v | ||
end | ||
end | ||
@new_version | ||
end | ||
|
||
if `git rev-parse --abbrev-ref HEAD`.strip != ('master' && 'HEAD') | ||
old_version = old_version?.tr('\'', '') | ||
new_version = new_version?.tr('\'', '') | ||
puts "Verifying Metdata Version - Old:#{old_version}, New:#{new_version}" | ||
if old_version == new_version | ||
raise 'You need to increment version before test will pass' | ||
end | ||
|
||
puts "Verifying Changelog Contains Version #{new_version}" | ||
counter = 0 | ||
f = File.read('CHANGELOG.md') | ||
f.each_line do |line| | ||
counter += 1 if line.match new_version | ||
end | ||
raise 'CHANGELOG update needed' if counter == 0 | ||
end | ||
end | ||
|
||
desc 'runs cookstyle' | ||
task cookstyle: [:setup_test_environment] do | ||
cmd = 'chef exec cookstyle -D --format offenses --display-cop-names' | ||
puts cmd | ||
sh(cmd) | ||
end | ||
|
||
desc 'runs foodcritic' | ||
task :foodcritic do | ||
cmd = "chef exec foodcritic --epic-fail any #{directory}" | ||
puts cmd | ||
sh(cmd) | ||
end | ||
|
||
desc 'runs foodcritic linttask' | ||
task :fc_new do | ||
FoodCritic::Rake::LintTask.new(:chef) do |t| | ||
t.options = { | ||
fail_tags: ['any'] | ||
} | ||
end | ||
end | ||
|
||
desc 'runs rspec' | ||
task :rspec do | ||
cmd = 'chef exec rspec --color --format documentation' | ||
puts cmd | ||
sh(cmd) | ||
end | ||
|
||
desc 'runs testkitchen' | ||
task :kitchen do | ||
cmd = 'chef exec kitchen test --concurrency=2' | ||
puts cmd | ||
sh(cmd) | ||
end | ||
|
||
desc 'clean up test files' | ||
task :clean do | ||
cmd = 'rm -fr berks-cookbooks knife.rb' | ||
puts cmd | ||
sh(cmd) | ||
end | ||
|
||
desc 'runs all tests except kitchen' | ||
task except_kitchen: [:verify_version, :cookstyle, :foodcritic, :rspec] do | ||
puts 'running all tests except kitchen' | ||
end | ||
|
||
desc 'runs all tests' | ||
task all: [:except_kitchen, :kitchen] do | ||
puts 'running all tests' | ||
end |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.