forked from DataDog/dd-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
skeleton.rb
50 lines (41 loc) · 1.32 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
47
48
49
50
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
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
raise exception if exception
end
end
end