forked from CDCgov/SDP-Vocabulary-Service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
33 lines (26 loc) · 855 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require_relative 'config/application'
Rails.application.load_tasks
if Rails.env != 'production'
require 'rubocop/rake_task'
RuboCop::RakeTask.new
task default: [:create_reports_dir, :rubocop, 'brakeman:run', 'bundle_audit:run',
'javascript:test', 'javascript:lint', 'erd:test', 'swagger:validate', 'cucumber']
end
task :create_reports_dir do
FileUtils.mkdir('./reports') unless Dir.exist?('./reports')
end
namespace :javascript do
task :test do
sh('yarn test')
end
task :lint do
sh('yarn run lint')
end
end
namespace :swagger do
task :validate do
sh('node node_modules/swagger-cli/bin/swagger-cli.js validate public/api/vocab.yaml')
end
end