-
-
Notifications
You must be signed in to change notification settings - Fork 58
/
Rakefile
71 lines (61 loc) · 1.83 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
#!/usr/bin/env ruby
#
require 'rspec/core/rake_task'
require './rake/pipeline'
require './rake/build/environment'
# Import build tasks
build_files = Dir.glob('rake/build/*.rake')
build_files.each { |file| import file }
task :default => ['build:all', 'setup:all']
# Hopefully it will speed up make calls from pip
desc 'Store build node nproc value'
task :nproc do
pipeline do
run hostname: opts[:buildnode] do
capture(:nproc).strip rescue nil
end
end.tap do |nproc|
pipeopts { build_nproc nproc }
end
end
namespace :build do
## Default build task, triggers the whole build task pipeline.
#
task :all => [:nproc, 'upload:to_buildnode', 'upload:checkout', 'build:packages'] do
pipeline do
run(:local) {|o| execute :ls, "-l #{o[:artifact_dir]}", verbosity: :debug}
end
end
## Packages task and build multitask (which invokes builds concurrently)
#
task :packages => [:prebuild, :build]
multitask :build => pipeopts.packages.map {|p| "package:#{p}"}
## Prebuild task invokes all packages prebuild tasks.
# These task are executed sequentially (we require this not to mess up pip)!
task :prebuild do
pipeopts.packages.each do |p|
task = "package:prebuild_#{p}"
if Rake::Task.task_defined?(task)
Rake::Task[task].invoke
end
end
end
end
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# SPECS SHOULD BE REWRITEN COMPLETLY THEY ARE SO BAD AND UGLY.
# But the are left for now since the do its work and we need
# to ship packages faster.
#
namespace :spec do
targets = []
Dir.glob('./rake/spec/*').each do |dir|
next unless File.directory?(dir)
targets << File.basename(dir)
end
task :all => targets
targets.each do |target|
RSpec::Core::RakeTask.new(target.to_sym) do |t|
t.pattern = "./rake/spec/#{target}/*_spec.rb"
end
end
end