Skip to content

Commit

Permalink
spec assets changes; require foodcritic only when -t provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruoran Wang committed Aug 1, 2012
1 parent 5c73543 commit 225df5d
Show file tree
Hide file tree
Showing 81 changed files with 167 additions and 2,967 deletions.
36 changes: 36 additions & 0 deletions README.rdoc
Expand Up @@ -19,6 +19,42 @@ $ chef-jenkins prop --config ~/chef-jenkins.rb --env-from dev --env-to qa
# Use the default config file - jenkins.rb # Use the default config file - jenkins.rb
$ chef-jenkins prop/sync $ chef-jenkins prop/sync


# Include tests for cookbook(s) (ruby test is knife cookbook test)
$ chef-jenkins sync --env-to ops -t ruby,foodcritic

# Freeze cookbook while uploading
$ chef-jenkins sync --env-to ops -f

== Config file

current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name "CHEF_CLIENT_NAME"
client_key "CHEF_CLIENT_KEY"
chef_server_url "URL"
cache_type 'BasicFile'
cache_options ( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path ["#{current_dir}/cookbooks", "#{current_dir}/site-cookbooks"]
role_path ["#{current_dir}/roles"]
data_bag_path ["#{current_dir}/data_bags"]

jenkins({
:repo_dir => current_dir,
:repo_url => 'CHEF_REPO_URL',
:git_user => "Jenkins CI",
:git_email => "jenkins@foo.bar",
:env_to => "ops",
:branch => "master",
:foodcritic => {
:fail_tags => ["correctness"],
:tags => [],
:include_rules => []
}
})

* For details about foodcritic check rules, see http://acrmp.github.com/foodcritic/

== Contributing to chef-jenkins == Contributing to chef-jenkins


* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
Expand Down
7 changes: 3 additions & 4 deletions lib/chef/jenkins.rb
Expand Up @@ -31,9 +31,6 @@
require 'chef/cookbook_loader' require 'chef/cookbook_loader'
require 'chef/cookbook_uploader' require 'chef/cookbook_uploader'
require 'chef/cookbook_version' require 'chef/cookbook_version'
require 'foodcritic'
require 'foodcritic/linter'
require 'foodcritic/output'
require 'git' require 'git'


class Chef class Chef
Expand Down Expand Up @@ -404,7 +401,9 @@ def sync(cookbook_path=Chef::Config[:cookbook_path], role_path=Chef::Config[:rol
# Run tests # Run tests
tests = Chef::Config[:test] tests = Chef::Config[:test]
if tests if tests
print "\n" require 'foodcritic'
require 'foodcritic/linter'
require 'foodcritic/output'
puts "## Testing Start" puts "## Testing Start"
knife_cookbook_test(cookbooks_to_change) if tests.include?("ruby") knife_cookbook_test(cookbooks_to_change) if tests.include?("ruby")
foodcritic_test(cookbooks_to_change) if tests.include?("foodcritic") foodcritic_test(cookbooks_to_change) if tests.include?("foodcritic")
Expand Down
78 changes: 0 additions & 78 deletions spec/assets/cookbooks/apache2/README.rdoc

This file was deleted.

87 changes: 0 additions & 87 deletions spec/assets/cookbooks/apache2/attributes/default.rb

This file was deleted.

26 changes: 0 additions & 26 deletions spec/assets/cookbooks/apache2/definitions/apache_conf.rb

This file was deleted.

43 changes: 0 additions & 43 deletions spec/assets/cookbooks/apache2/definitions/apache_module.rb

This file was deleted.

40 changes: 0 additions & 40 deletions spec/assets/cookbooks/apache2/definitions/apache_site.rb

This file was deleted.

49 changes: 0 additions & 49 deletions spec/assets/cookbooks/apache2/definitions/web_app.rb

This file was deleted.

0 comments on commit 225df5d

Please sign in to comment.