forked from DataDog/dd-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
skeleton.rb
46 lines (38 loc) · 1.21 KB
/
skeleton.rb
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
require './ci/common'
namespace :ci do
namespace :my_new_flavor do |flavor|
task before_install: ['ci:common:before_install']
task install: ['ci:common:install']
task before_script: ['ci:common:before_script']
# If you need to wait on a start of a progran, please use Wait.for,
# see https://github.com/DataDog/dd-agent/pull/1547
task script: ['ci:common:script'] do
this_provides = [
'my_new_flavor'
]
Rake::Task['ci:common:run_tests'].invoke(this_provides)
end
task before_cache: ['ci:common:before_cache']
task cache: ['ci:common:cache']
task cleanup: ['ci:common:cleanup']
task :execute do
exception = nil
begin
%w(before_install install before_script
script before_cache cache).each do |t|
Rake::Task["#{flavor.scope.path}:#{t}"].invoke
end
rescue => e
exception = e
puts "Failed task: #{e.class} #{e.message}".red
end
if ENV['SKIP_CLEANUP']
puts 'Skipping cleanup, disposable environments are great'.yellow
else
puts 'Cleaning up'
Rake::Task["#{flavor.scope.path}:cleanup"].invoke
end
fail exception if exception
end
end
end