Skip to content

Commit

Permalink
Chef 12 migration (#59)
Browse files Browse the repository at this point in the history
* fix deprecation warning, using allow instead of should_receive

* chef 12 migration

* updating from skeleton for tests

* updating for cookstyle

* removing berksfile.lock

* adding .travis_install.sh

* removing centos7.0

* removing apt

* updating ruby-version

* updating rakefile and travis

* pinning Berksfile.lock

* updating readme to chef12
  • Loading branch information
rshade authored Jan 6, 2017
1 parent 5846746 commit 959b9a1
Show file tree
Hide file tree
Showing 28 changed files with 597 additions and 178 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.vagrant
Berksfile.lock
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~
/cookbooks
cache_dir

# Bundler
Gemfile.lock
Expand All @@ -16,3 +16,10 @@ bin/*
VERSION
.kitchen/
.kitchen.local.yml

doc/
.yardoc/
berks-cookbooks/
knife.rb
syntaxcache/
coverage/
50 changes: 18 additions & 32 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,36 @@
---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: 11.6.0
customize:
cpus: 1
memory: 512
ssh:
insert_key: false

provisioner:
name: chef_zero
always_update_cookbooks: true
require_chef_omnibus: 12.16.42

platforms:
- name: centos-5.9
driver_config:
box: opscode-centos-5.9
- name: centos-6.5
driver_config:
box: opscode-centos-6.5
- name: centos-7.0
driver_config:
box: opscode-centos-7.0
attributes:
ephemeral_lvm:
filesystem: xfs
- name: centos-7.1
driver_config:
box: opscode-centos-7.1
attributes:
ephemeral_lvm:
filesystem: xfs
- name: debian-7.2.0
driver_config:
box: opscode-debian-7.2.0
- name: rhel-6.5
- name: centos-6.8
driver_config:
box: local-rhel-6.5
box_url: file://<%= File.expand_path('~') %>/opscode_rhel-6.5_chef-provisionerless.box
- name: rhel-7.1
box: bento/centos-6.8
- name: centos-7.2
driver_config:
box: opscode-rhel-7.1
box_url: https://s3.amazonaws.com/st-vagrant-boxes/opscode_rhel-7.1_chef-provisionerless.box
box: bento/centos-7.2
attributes:
ephemeral_lvm:
filesystem: xfs
- name: ubuntu-10.04
- name: debian-7.11
driver_config:
box: opscode-ubuntu-10.04
box: bento/debian-7.11
- name: ubuntu-12.04
driver_config:
box: opscode-ubuntu-12.04
box: bento/ubuntu-12.04
- name: ubuntu-14.04
driver_config:
box: opscode-ubuntu-14.04
box: bento/ubuntu-14.04

suites:
# This test suite mimics the behavior of being in a cloud which supports block device mapping
Expand Down
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--format documentation
13 changes: 13 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
AllCops:
Exclude:
- 'berks-cookbooks/**/*'
- 'knife.rb'
Style/AccessorMethodName:
Exclude:
- 'Rakefile'
Metrics/BlockNesting:
Exclude:
- 'libraries/helper.rb'
Style/GuardClause:
Exclude:
- 'test/cookbooks/fake/recipes/gce.rb'
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3.1
14 changes: 9 additions & 5 deletions .travis.yml
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: SqcVb40KzZcnESU9VKcUWpEmrPUamdrgqfmBAfndtHkGP4Pg3sESgPbZdY3CFsHtzjXV6I9LU+1b9YU3IXcKTos/+Eky5QixBxGwS2lq7yMB+FWHbi4FLvf9KaYx3lMwMuBzEmnJxMhbE7VX6rQk/FayR+0Og7g/InQKRVMJlMc=
secure: Nhz+yIbiEFxLUQqHe0EisN/r7gGSFfqm16eRRsCI9mMUiN6J9ao6/N6kE/YGcShDUO/rG1wvf0j9HEDE10kefQpVV1bp9AdDQfgYZJtYiV41xg3eJYquQcVRL96Fl7Td3gtazvGG6xwxjrZMFHz9tX1LTAD1/YWFUHn/NvdRB/Y=
8 changes: 8 additions & 0 deletions .travis_install.sh
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
4 changes: 2 additions & 2 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
site :opscode
source 'https://supermarket.chef.io'

metadata

cookbook "fake", path: "./test/cookbooks/fake", group: :integration
cookbook 'fake', path: './test/cookbooks/fake', group: :integration
12 changes: 12 additions & 0 deletions Berksfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DEPENDENCIES
ephemeral_lvm
path: .
metadata: true
fake
path: test/cookbooks/fake

GRAPH
ephemeral_lvm (2.0.0)
lvm (~> 3.1)
fake (0.1.0)
lvm (3.1.0)
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ ephemeral_lvm Cookbook CHANGELOG

This file is used to list changes made in each version of the ephemeral_lvm cookbook.

v2.0.0
-------

- Add support for chef 12
- Remove support for chef 11

v1.0.17
-------

Expand Down Expand Up @@ -110,4 +116,4 @@ v1.0.0
[#54]: https://github.com/rightscale-cookbooks/ephemeral_lvm/issues/54
[@autrejacoupa]: https://github.com/autrejacoupa
[@drywheat]: https://github.com/drywheat
[@juliandunn]: https://github.com/juliandunn
[@juliandunn]: https://github.com/juliandunn
17 changes: 2 additions & 15 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
source 'https://rubygems.org'

gem 'berkshelf'
gem 'thor-foodcritic'
gem 'thor-scmversion'
gem 'rack', '= 1.6.4'
gem 'json', '~> 1.8', '>= 1.8.3'
gem 'buff-ignore', '~> 1.1.1'
gem 'net-http-persistent', '= 2.9.4'

gem 'rake'
gem 'chef', '~> 12.16'

group :integration do
gem 'test-kitchen', '~> 1.2.1'
gem 'kitchen-vagrant'
end

group :test do
gem 'chefspec', '~> 3.4.0'
gem 'strainer', '~> 3.3.0'
end
Loading

0 comments on commit 959b9a1

Please sign in to comment.