6950ed521a
Having a Rakefile will allow us to change the actual test commands on our side rather than relying on changes to the openstack-infra repository. This should make it a lot faster to change things, but also easier to test since the jenkins jobs are actually run in this repository, not the openstack-infra one. This commit defines the jobs we previously had defined in Jenkins and uses 'high-level' naming consistently (i.e. lint, style vs. foodcritic, rubocop). There is also a :clean task to help with deleting the files generated by the other jobs. Also changed foodcritic to run on the source cookbook rather than the one installed by berks, see e.g. https://github.com/berkshelf/berkshelf/issues/931#issuecomment-29668369 Change-Id: I7fee4e90c2f50e3c8467a0af93118c696400eafb blueprint: rakefile
34 lines
624 B
Ruby
34 lines
624 B
Ruby
task default: ["test"]
|
|
|
|
task :test => [:lint, :style, :unit]
|
|
|
|
task :bundler_prep do
|
|
mkdir_p '.bundle'
|
|
sh %{bundle install --path=.bundle --jobs 1 --retry 3 --verbose}
|
|
end
|
|
|
|
task :berks_prep => :bundler_prep do
|
|
sh %{bundle exec berks vendor}
|
|
end
|
|
|
|
task :lint => :bundler_prep do
|
|
sh %{bundle exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .}
|
|
end
|
|
|
|
task :style => :bundler_prep do
|
|
sh %{bundle exec rubocop}
|
|
end
|
|
|
|
task :unit => :berks_prep do
|
|
sh %{bundle exec rspec --format documentation}
|
|
end
|
|
|
|
task :clean do
|
|
rm_rf [
|
|
'.bundle',
|
|
'berks-cookbooks',
|
|
'Gemfile.lock',
|
|
'Berksfile.lock'
|
|
]
|
|
end
|