-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9da952c
Showing
11 changed files
with
102 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## v0.1.0 | ||
|
||
* Initial release. |
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,37 @@ | ||
# template-cookbook | ||
|
||
## Description | ||
|
||
A cool description – preferably wrapped at 80 characters. | ||
|
||
## Requirements | ||
|
||
### Platforms | ||
|
||
* RedHat 6.3 (Santiago) | ||
* Ubuntu 11.10 (Oneiric) | ||
* Ubuntu 12.04 (Precise) | ||
|
||
### Cookbooks | ||
|
||
* apache2 | ||
* logrotate | ||
|
||
## Attributes | ||
|
||
* `node["template_cookbook"]["version"]` - Version of template-cookbook to | ||
install. | ||
* `node["template_cookbook"]["user"]` - User for template-cookbook. | ||
* `node["template_cookbook"]["group"]` - Group for template-cookbook. | ||
|
||
## Recipes | ||
|
||
* `recipe[template-cookbook]` will install template-cookbook. | ||
* `recipe[template-cookbook::alternate]` will install alternate | ||
template-cookbook. | ||
|
||
## Usage | ||
|
||
A short write-up of any usage specific instructions. For example, default | ||
passwords, examples of attributes that alter recipe behavior, and | ||
auto-discovery of dependant services. |
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,25 @@ | ||
desc "Runs foodcritic" | ||
task :foodcritic do | ||
if Gem::Version.new("1.9.2") <= Gem::Version.new(RUBY_VERSION.dup) | ||
sandbox = File.join(File.dirname(__FILE__), %w{tmp foodcritic cookbook}) | ||
prepare_foodcritic_sandbox(sandbox) | ||
|
||
sh "foodcritic --epic-fail any #{File.dirname(sandbox)}" | ||
else | ||
STDERR.puts "WARN: foodcritic run is skipped as Ruby #{RUBY_VERSION} is < 1.9.2." | ||
end | ||
end | ||
|
||
task :default => "foodcritic" | ||
|
||
private | ||
|
||
def prepare_foodcritic_sandbox(sandbox) | ||
files = %w{*.md *.rb attributes definitions files providers | ||
recipes resources templates} | ||
|
||
rm_rf sandbox | ||
mkdir_p sandbox | ||
cp_r Dir.glob("{#{files.join(',')}}"), sandbox | ||
puts "\n\n" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
default["template_cookbook"]["version"] = "1.2.3" | ||
default["template_cookbook"]["user"] = "template_user" | ||
default["template_cookbook"]["group"] = "template_user" |
7 changes: 7 additions & 0 deletions
7
files/default/tests/minitest/support/template_cookbook_alternate_test.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,7 @@ | ||
require "minitest/autorun" | ||
|
||
describe_recipe "template-cookbook::alternate" do | ||
include MiniTest::Chef::Assertions | ||
include MiniTest::Chef::Context | ||
include MiniTest::Chef::Resources | ||
end |
7 changes: 7 additions & 0 deletions
7
files/default/tests/minitest/support/template_cookbook_test.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,7 @@ | ||
require "minitest/autorun" | ||
|
||
describe_recipe "template-cookbook::default" do | ||
include MiniTest::Chef::Assertions | ||
include MiniTest::Chef::Context | ||
include MiniTest::Chef::Resources | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
maintainer "The Wharton School - The University of Pennsylvania" | ||
maintainer_email "[email protected]" | ||
license "Apache 2.0" | ||
description "A cool description." | ||
version "0.1.0" | ||
recipe "template-cookbook", "Short description of template-cookbook default recipe." | ||
recipe "template-cookbook::alternate", "Short description of template-cookbook::alternate recipe." | ||
|
||
%w{ apache2 logrotate }.each do |d| | ||
depends d | ||
end | ||
|
||
%w{ redhat ubuntu }.each do |os| | ||
supports os | ||
end |
Empty file.
Empty file.
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 @@ | ||
A cool story. |
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,4 @@ | ||
source :rubygems | ||
|
||
gem "rake" | ||
gem "foodcritic" |