OSDN Git Service

improve the backup and restore scripts.
[metasearch/grid-chef-repo.git] / cookbooks / minio-grid / Rakefile
1 require 'rspec/core/rake_task'
2 require 'rubocop/rake_task'
3 require 'foodcritic'
4 require 'stove/rake_task'
5
6 task :'set-pipeline' do
7   sh [
8     "fly -t $CC_TARGET sp -p #{File.basename(Dir.pwd)}-cookbook -c concourse.yml",
9     '-l fly-vars.yml -l ~/sec/credentials-prod.yml',
10   ].join(' ')
11 end
12 task sp: 'set-pipeline'
13
14 namespace :style do
15   desc 'Run Ruby style checks'
16   RuboCop::RakeTask.new(:ruby) do |t|
17     t.options = [
18       '--auto-gen-config',  # creates .rubocop_todo.yml
19     ]
20   end
21
22   desc 'Run Chef style checks'
23   FoodCritic::Rake::LintTask.new(:chef) do |t|
24     t.options = {
25       fail_tags: ['any'],
26     }
27   end
28 end
29
30 desc 'Run all style checks'
31 task style: ['style:chef', 'style:ruby']
32
33 desc 'Run ChefSpec examples'
34 RSpec::Core::RakeTask.new(:spec)
35
36 desc 'Publish cookbook'
37 Stove::RakeTask.new(:publish) do |t|
38   t.stove_opts = [
39     # `--username` and `--key` are set in ~/.stove typically.
40     #'--username', 'somebody',
41     #'--key', '~/chef/chef.io.example.com/somebody.pem',
42     #'--endpoint', 'https://supermarket.io.example.com/api/v1',  # default: supermarket.chef.io
43     #'--no-ssl-verify',
44     '--no-git',
45     '--log-level', 'info',
46   ]
47 end
48
49 task default: ['style', 'spec']