Skip to content

Commit

Permalink
Merge pull request #7 from josacar/update-testing
Browse files Browse the repository at this point in the history
Update cookbook testing framework
  • Loading branch information
joseluis-fw authored Oct 28, 2019
2 parents 487e454 + 778c52f commit 53c1b80
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 22 deletions.
1 change: 1 addition & 0 deletions .delivery/project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
10 changes: 5 additions & 5 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
driver:
name: dokken
privileged: false
chef_version: 12.12.13
chef_version: 15.4.45

transport:
name: dokken

provisioner:
name: dokken
client_rb:
chef_license: "accept-silent"

platforms:
- name: debian
driver_config:
image: debian:8.4
image: debian:10
intermediate_instructions:
- RUN /usr/bin/apt-get update &&
/usr/bin/apt-get install apt-transport-https net-tools curl openssl --yes --no-install-recommends &&
curl -L http://httpredir.debian.org/debian/pool/main/c/ca-certificates/ca-certificates_20130119%2bdeb7u1_all.deb -o ca-certificates_20130119+deb7u1_all.deb &&
dpkg -i ca-certificates_20130119+deb7u1_all.deb
/usr/bin/apt-get install apt-transport-https net-tools curl openssl --yes --no-install-recommends

verifier:
name: inspec
Expand Down
37 changes: 23 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,53 @@
sudo: required
dist: trusty
addons:
apt:
sources:
- chef-current-trusty
- chef-current-xenial
packages:
- chefdk
- chef-workstation

install: echo "skip bundle install"

services: docker

env:
matrix:
- INSTANCE=create-debian
- INSTANCE=delete-debian
global:
- CHEF_LICENSE=accept-no-persist
- secure: n4MaHS184i4t/Mz9dQ7x5dVq5p6bg+G/aAVMrCk4VZpb7oKuY0cYA6Lt8NakG2iXNEFbj1D2bUw3HtGC/er/IF/bkwTO5eLciH3feAN46MIgyGTJ3MmE6dcJVV5oJZLVxJbkDhCkp5V3D+1fhMKLa7u/V535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dFVv4zm/IcP78WLfAiqQiF9n8HA3WJF+6KPZDcJo9hQDZ604tDXnJcpda9Le9G4XSOgb2cuUT01U7MbznTlbI/n5fWjBpUJlBlTV2eXAIuoAX0hJPXOygpy4TWh7HfqGIii43F6peooDKJMBdyXYL+r58PP8=

before_script:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
- /opt/chefdk/embedded/bin/chef gem install kitchen-dokken glare
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/cookstyle --version
- /opt/chefdk/embedded/bin/foodcritic --version
- eval "$(chef shell-init bash)"
- chef --version
- cookstyle --version
- foodcritic --version
- gem install glare --version 0.8.0

script:
- 'if [ "$TRAVIS_REPO_SLUG" = "peertransfer/glare-cookbook" ]; then KITCHEN_LOCAL_YAML=.kitchen.yml kitchen verify ${INSTANCE}; fi'
- 'if [ "$TRAVIS_REPO_SLUG" = "peertransfer/glare-cookbook" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then KITCHEN_LOCAL_YAML=.kitchen.yml kitchen verify ${INSTANCE}; fi'

after_script:
- docker images
- docker ps -a
- cat .kitchen/logs/kitchen.log

matrix:
include:
- script: "/opt/chefdk/embedded/bin/cookstyle"
- script: cookstyle
env: COOKSTYLE=1
- script: "/opt/chefdk/embedded/bin/foodcritic . --exclude spec -f any -P"
- script: foodcritic . --exclude spec -f any -P
env: FOODCRITIC=1
- script: "/opt/chefdk/embedded/bin/rspec"
env: CHEFSPEC=1
- script: chef exec delivery local all
env:
- CHEFSPEC=1

before_deploy:
- openssl aes-256-cbc -K $encrypted_e61592b9331f_key -iv $encrypted_e61592b9331f_iv
-in .travis/ssh_rsa.enc -out .travis/client.pem -d

deploy:
provider: chef-supermarket
user_id: flywire
Expand Down
5 changes: 2 additions & 3 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
maintainer_email '[email protected]'
license 'MIT'
description 'Manages Cloudflare resources via API v4'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.3.0'
version '1.4.0'

source_url 'https://github.com/peertransfer/glare-cookbook'
issues_url 'https://github.com/peertransfer/glare-cookbook/issues'
Expand All @@ -15,4 +14,4 @@

chef_version '>= 12.6'

gem 'glare', '~> 0.7'
gem 'glare', '~> 0.8'

0 comments on commit 53c1b80

Please sign in to comment.