forked from puppetlabs/puppetlabs-release
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
48 lines (41 loc) · 1.39 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
# The 'packaging' gem requires these for configuration information.
# See: https://github.com/puppetlabs/build-data
ENV['TEAM'] = 'release'
ENV['PROJECT_ROOT'] = Dir.pwd
require 'packaging'
Pkg::Util::RakeUtils.load_packaging_tasks
desc 'Create packages from release-file definitions'
task :build do
projects = Dir.glob('source/projects/*.json').map do |json_file_name|
File.basename(json_file_name, '.json')
end.join(' ')
sh "./ci/create-packages #{projects}"
end
desc 'Sign packages'
task :sign do
Dir.glob('source/projects/*.json').each do |json_file_name|
project_name = File.basename(json_file_name, '.json')
Dir.chdir(project_name) do
Pkg::Util::RakeUtils.invoke_task('pl:jenkins:sign_all', 'output')
end
end
end
desc 'Upload packages to builds and Artifactory'
task :ship do
Dir.glob('source/projects/*.json').each do |json_file_name|
project_name = File.basename(json_file_name, '.json')
ENV['PROJECT_OVERRIDE'] = project_name
Dir.chdir(project_name) do
Pkg::Util::RakeUtils.invoke_task('pl:jenkins:ship', 'artifacts', 'output')
Pkg::Util::RakeUtils.invoke_task('pl:jenkins:ship_to_artifactory', 'output')
end
end
end
desc 'Clean up build and output directories'
task :clean do
rm_rf 'build'
Dir.glob('source/projects/*.json').each do |json_file_name|
project_name = File.basename(json_file_name, '.json')
rm_rf project_name
end
end