2014-03-14 08:23:28 -04:00
|
|
|
Rake::Task["spinach"].clear if Rake::Task.task_defined?('spinach')
|
2014-03-14 04:44:16 -04:00
|
|
|
|
|
|
|
desc "GITLAB | Run spinach"
|
|
|
|
task :spinach do
|
2015-01-30 02:06:43 -05:00
|
|
|
tags = if ENV['SEMAPHORE']
|
2015-01-30 02:28:38 -05:00
|
|
|
'~@tricky'
|
2015-01-30 02:06:43 -05:00
|
|
|
else
|
2015-01-30 02:28:38 -05:00
|
|
|
'~@semaphore'
|
2015-01-30 02:06:43 -05:00
|
|
|
end
|
|
|
|
|
2014-03-14 04:44:16 -04:00
|
|
|
cmds = [
|
|
|
|
%W(rake gitlab:setup),
|
2015-01-30 02:06:43 -05:00
|
|
|
%W(spinach --tags #{tags}),
|
2014-03-14 04:44:16 -04:00
|
|
|
]
|
2014-06-04 16:55:27 -04:00
|
|
|
run_commands(cmds)
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "GITLAB | Run project spinach features"
|
|
|
|
task :spinach_project do
|
|
|
|
cmds = [
|
|
|
|
%W(rake gitlab:setup),
|
|
|
|
%W(spinach --tags ~@admin,~@dashboard,~@profile,~@public,~@snippets),
|
|
|
|
]
|
|
|
|
run_commands(cmds)
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "GITLAB | Run other spinach features"
|
|
|
|
task :spinach_other do
|
|
|
|
cmds = [
|
|
|
|
%W(rake gitlab:setup),
|
|
|
|
%W(spinach --tags @admin,@dashboard,@profile,@public,@snippets),
|
|
|
|
]
|
|
|
|
run_commands(cmds)
|
|
|
|
end
|
2014-03-14 04:44:16 -04:00
|
|
|
|
2014-06-04 16:55:27 -04:00
|
|
|
def run_commands(cmds)
|
2014-03-14 04:44:16 -04:00
|
|
|
cmds.each do |cmd|
|
2014-05-27 01:12:03 -04:00
|
|
|
system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) or raise("#{cmd} failed!")
|
2014-03-14 04:44:16 -04:00
|
|
|
end
|
|
|
|
end
|