-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
52 lines (42 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
require_relative 'environment_configuration'
require 'rspec/core/rake_task'
SINATRA_PORT = retrieve_port
TRAVIS = retrieve_travis
task :default => :start
task :start do
if (TRAVIS == false)
sh "rerun --background -- rackup --port #{SINATRA_PORT} -o 0.0.0.0"
end
if (TRAVIS == true)
File.delete('travis.ci')
sh "rerun --background -- rackup --port #{SINATRA_PORT} -o 0.0.0.0 &"
sh "sleep 1"
sh 'rspec spec/integration'
sh 'rspec spec/tdd'
sh 'rspec spec/bdd'
end
end
task :tdd do
sh 'rspec spec/tdd'
end
task :bdd do
sh 'rspec spec/bdd'
end
task :integration do
sh 'rspec spec/integration'
end
task :test => [:bdd, :tdd, :integration] do
end
task :build do
sh "docker build -f Dockerfile.build -t culturaaccesible-system ."
sh "docker tag culturaaccesible-system devscola/culturaaccesible-system:build"
sh "docker push devscola/culturaaccesible-system:build"
end
task :tag, [:tag] do |t, arg|
sh "rspec --tag #{arg.tag}"
end
desc 'Run labeled tests'
RSpec::Core::RakeTask.new do |test, args|
test.pattern = Dir['spec/**/*_spec.rb']
test.rspec_opts = args.extras.map { |tag| "--tag #{tag}" }
end