forked from cucumber/aruba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
80 lines (60 loc) · 2.01 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
$LOAD_PATH << File.expand_path(__dir__)
require 'aruba/tasks/docker_helpers'
require 'aruba/platform'
require 'bundler'
Bundler.setup
task default: %w(spec cucumber cucumber:wip lint)
desc 'Run all linters.'
task lint: %w(lint:coding_guidelines lint:licenses)
desc 'Run the whole test suite.'
task test: %w(spec cucumber cucumber:wip)
require 'cucumber/rake/task'
require 'rspec/core/rake_task'
Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{--format progress}
end
Cucumber::Rake::Task.new('cucumber:wip', 'Run Cucumber features '\
'which are "WORK IN PROGRESS" and '\
'are allowed to fail') do |t|
t.cucumber_opts = %w{--format progress}
t.profile = 'wip'
end
RSpec::Core::RakeTask.new
namespace :lint do
desc 'Lint our code with "rubocop"'
task :coding_guidelines do
sh 'bundle exec rubocop'
end
desc 'Check for relevant licenses in project'
task :licenses do
sh 'bundle exec license_finder'
end
require 'yard-junk/rake'
YardJunk::Rake.define_task
end
Bundler::GemHelper.install_tasks
namespace :docker do
desc 'Build docker image'
task :build, :cache, :version do |_, args|
args.with_defaults(version: 'latest')
args.with_defaults(cache: true)
docker_compose_file = Aruba::DockerComposeFile.new(File.expand_path('docker-compose.yml', __dir__))
docker_run_instance = Aruba::DockerRunInstance.new(docker_compose_file, :base)
builder = Aruba::DockerBuildCommandLineBuilder.new(
docker_run_instance,
cache: args[:cache],
version: args[:version]
)
sh builder.to_cli
end
desc 'Run docker container'
task :run, :command do |_, args|
docker_compose_file = Aruba::DockerComposeFile.new(File.expand_path('docker-compose.yml', __dir__))
docker_run_instance = Aruba::DockerRunInstance.new(docker_compose_file, :base)
builder = Aruba::DockerRunCommandLineBuilder.new(
docker_run_instance,
command: args[:command] || docker_run_instance.command
)
sh builder.to_cli
end
end