Skip to content

Commit 28cab5f

Browse files
committedApr 19, 2018
chef 13
1 parent 8626188 commit 28cab5f

File tree

10 files changed

+33
-34
lines changed

10 files changed

+33
-34
lines changed
 

‎.foodcritic

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# FC078: Ensure cookbook shared under an OSI-approved open source license
2+
~FC078

‎attributes/default.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# encoding: UTF-8
2-
#
3-
# Author:: Shawn Neal (<sneal@sneal.net>)
2+
3+
# Author:: Daptiv Engineering (<cpc_sea_teamengineering@changepoint.com>)
44
# Cookbook Name:: dotnetframework
55
# Attribute:: default
66
#
7-
# Copyright:: Copyright (c) 2013 Daptiv Solutions LLC.
7+
# Copyright:: Copyright (c) 2018 Changepoint
88
#
99
# Licensed under the Apache License, Version 2.0 (the "License");
1010
# you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
# limitations under the License.
2020
#
2121

22+
# rubocop:disable VariableNumber
2223
# Allows the cookbook the compile without error on Linux
2324
if RUBY_PLATFORM =~ /mswin|mingw32|windows/
2425
require 'chef/win32/version'

‎docker-compose.yml

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# How to use this file:
2-
# export COOKBOOK=${PWD##*/} && docker-compose run --rm test chef exec rake
2+
# export COOKBOOK=${PWD##*/} && docker-compose run --rm test
33

44
version: '2'
55
services:
@@ -10,13 +10,15 @@ services:
1010
- ${CHEF_CONFIG_DIR}:/root/.chef
1111
- ${CHEF_REPO_DIR}:/chef-repo
1212
- ${AWS_CRED_DIR}:/root/.aws
13-
- ${BERKSHELF_PATH}:/root/.berkshelf
13+
- ${SSH_KEY_DIR}:/root/.ssh
1414
working_dir: /${COOKBOOK}
1515
network_mode: "host"
1616
environment:
17-
COOKBOOK: ${COOKBOOK}
1817
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
1918
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
19+
CHEF_DATA_BAGS: /chef-repo/data_bags
20+
CHEF_SECRET_FILE: /root/.chef/${CHEF_SECRET_FILE}
21+
COOKBOOK: ${COOKBOOK}
2022
EC2_ROLE_ARN: ${EC2_ROLE_ARN}
2123
EC2_SSH_KEY_ID: ${EC2_SSH_KEY_ID}
2224
EC2_REGION: ${EC2_REGION}
@@ -26,14 +28,7 @@ services:
2628
EC2_IMAGE_NAME: ${EC2_IMAGE_NAME}
2729
EC2_SG: ${EC2_SG}
2830
LATEST_PPM_PACKAGE: ${LATEST_PPM_PACKAGE}
29-
CHEF_DATA_BAGS: /chef-repo/data_bags
30-
CHEF_SECRET_FILE: /root/.chef/${CHEF_SECRET_FILE}
31-
KITCHEN_YAML: ".kitchen_ec2.yml"
32-
KNIFE_HOME: /root/.chef
31+
REQUIRE_CHEF_OMNIBUS: ${REQUIRE_CHEF_OMNIBUS}
3332
WIN_USER: ${WIN_USER}
3433
WIN_PASS: ${WIN_PASS}
35-
command: |
36-
bash -c 'bash -s <<EOF
37-
echo "Please enter the command to execute:"
38-
echo "Ex: docker-compose run --rm test chef exec bundle install"
39-
EOF'
34+
command: "'chef exec rake'"

‎libraries/matchers.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# encoding: UTF-8
2-
#
3-
# Author:: Shawn Neal (<sneal@sneal.net>)
2+
3+
# Author:: Daptiv Engineering (<cpc_sea_teamengineering@changepoint.com>)
44
# Cookbook Name:: dotnetframework
55
#
6-
# Copyright 2015, Shawn Neal
6+
# Copyright 2018 Changepoint
77
#
88
# Licensed under the Apache License, Version 2.0 (the "License");
99
# you may not use this file except in compliance with the License.

‎metadata.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name 'dotnetframework'
2-
maintainer 'Daptiv Solutions, LLC'
3-
maintainer_email 'sneal@sneal.net'
2+
maintainer 'Changepoint'
3+
maintainer_email 'cpc_sea_teamengineering@changepoint.com'
44
license 'All rights reserved'
55
description 'Installs/Configures .NET Framework'
66
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
77
ver_path = File.join(File.dirname(__FILE__), 'version.txt')
88
version File.exist?(ver_path) ? IO.read(ver_path).chomp : '1.1.0'
9+
chef_version '>= 12.5' if respond_to?(:chef_version)
910
issues_url 'https://github.com/daptiv/dotnetframework/issues'
1011
source_url 'https://github.com/daptiv/dotnetframework/'
1112
supports 'windows'

‎rakefile.rb

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
task default: [:version, :rubocop, :foodcritic, :spec, :kitchen, :cleanup]
2-
task nokitchen: [:version, :rubocop, :foodcritic, :spec]
1+
# rubocop:disable Metrics/BlockLength
2+
task default: %i[version rubocop foodcritic spec kitchen cleanup]
3+
task nokitchen: %i[version rubocop foodcritic spec]
34

45
desc 'Set cookbook version.'
56
task :version do
6-
version = ENV['BUILD_NUMBER'] ? "1.2.#{ENV['BUILD_NUMBER']}" : '1.2.0'
7+
version = ENV['BUILD_NUMBER'] ? "1.2.#{ENV['BUILD_NUMBER']}" : '0.0.1'
78
IO.write('version.txt', version)
89
end
910

@@ -31,11 +32,11 @@
3132
end
3233

3334
desc 'Test Kitchen.'
34-
task :kitchen, [:type] => [:check_env_vars, :assume_role] do |_t, args|
35+
task :kitchen, [:type] => %i[check_env_vars assume_role] do |_t, args|
3536
task_thread = []
3637
kitchen_complete = false
3738
start_time = Time.now
38-
%w(kitchen assume_role).each do |task|
39+
%w[kitchen assume_role].each do |task|
3940
task_thread << Thread.new do
4041
case task
4142
when 'kitchen'

‎recipes/default.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# encoding: UTF-8
2-
#
3-
# Author:: Shawn Neal (<sneal@sneal.net>)
2+
3+
# Author:: Daptiv Engineering (<cpc_sea_teamengineering@changepoint.com>)
44
# Cookbook Name:: dotnetframework
55
# Recipe:: default
66
#
7-
# Copyright:: Copyright (c) 2013 Daptiv Solutions LLC.
7+
# Copyright:: Copyright (c) 2018 Changepoint
88
#
99
# Licensed under the Apache License, Version 2.0 (the "License");
1010
# you may not use this file except in compliance with the License.

‎recipes/regiis.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#
2-
# Author:: Shawn Neal (<sneal@sneal.net>)
2+
# Author:: Daptiv Engineering (<cpc_sea_teamengineering@changepoint.com>)
33
# Cookbook Name:: dotnetframework
44
# Recipe:: regiis
55
#
6-
# Copyright:: Copyright (c) 2013 Daptiv Solutions LLC.
6+
# Copyright:: Copyright (c) 2018 Changepoint
77
#
88
# Licensed under the Apache License, Version 2.0 (the "License");
99
# you may not use this file except in compliance with the License.

‎resources/version.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# encoding: UTF-8
2-
#
3-
# Author:: Shawn Neal (<sneal@sneal.net>)
2+
3+
# Author:: Daptiv Engineering (<cpc_sea_teamengineering@changepoint.com>)
44
# Cookbook Name:: dotnetframework
55
# Resource:: edition
66
#
7-
# Copyright 2015, Shawn Neal
7+
# Copyright 2018 Changepoint
88
#
99
# Licensed under the Apache License, Version 2.0 (the "License");
1010
# you may not use this file except in compliance with the License.

‎spec/spec_helper.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
require 'rspec/expectations'
21
require 'chefspec'
32
require 'chefspec/berkshelf'
43

0 commit comments

Comments
 (0)
Please sign in to comment.