-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
52 lines (40 loc) · 1.13 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# frozen_string_literal: true
ENV['RACK_ENV'] ||= 'development'
require_relative 'config/environment'
require 'sinatra/activerecord/rake'
require 'rspec/core/rake_task'
task default: :spec
desc 'Starts the thin web server through rackup.'
task :serve do
`bundle exec rackup -p 9292`
end
desc 'Starts the puma web server with rerun'
task :rerun do
`bundle exec rerun --dir app,config,public -- rackup --port=9292`
end
RSpec::Core::RakeTask.new(:spec)
desc 'Run all tests, even those usually excluded.'
task all_tests: :environment do
ENV['RUN_ALL_TESTS'] = 'true'
Rake::Task['spec'].invoke
end
# does not work - but the executed cmd manually does
# desc 'Simulate autotest with rerun.'
# task :autotest do
# ENV['RUN_ALL_TESTS'] = 'true'
# `bundle exec rerun -cx rspec`
# end
desc 'Cleanup expired bins.'
task cleanup: :environment do
Bin.cleanup
end
desc 'Prepare db and serve.'
task :migrateserv do
Rake::Task['db:migrate'].invoke
Rake::Task['serve'].invoke
end
task :after_migration_hook do
ENV['SCHEMA_FORMAT'] = 'sql'
Rake::Task['db:schema:dump'].invoke
end
Rake::Task['db:migrate'].enhance [:after_migration_hook]