forked from fluent/fluent-package-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
executable file
·84 lines (75 loc) · 2.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env rake
#
# fluent-package-builder
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
PACKAGES = [
"fluent-package",
]
APT_SOURCE_PACKAGES = [
"fluent-apt-source",
"fluent-lts-apt-source",
]
ALL_PACKAGE = [
"fluent-package",
"fluent-apt-source",
"fluent-lts-apt-source",
]
def define_bulked_task(name, description, packages = PACKAGES)
desc description
task name.to_sym do
packages.each do |package|
cd(package) do
ruby("-S", "rake", name.to_s)
end
end
end
end
[
["clean", "Remove any temporary products", ALL_PACKAGE],
["clobber", "Remove any generated files", ALL_PACKAGE],
["build:deb_config", "Create configuration files for Debian like systems"],
["build:rpm_config", "Create configuration files for Red Hat like systems with systemd"],
["build:all", "Install all components"],
["apt:build", "Build deb packages"],
["yum:build", "Build RPM packages"],
["msi:build", "Build MSI package (alias for msi:dockerbuild)"],
["msi:selfbuild", "Build MSI package without using Docker"],
["msi:dockerbuild", "Build MSI package by Docker"],
["dmg:selfbuild", "Build macOS package without using Docker"],
].each do |params|
define_bulked_task(*params)
end
[
["apt:build", "Build fluent-apt-source deb packages", APT_SOURCE_PACKAGES],
].each do |params|
define_bulked_task(*params)
end
if ENV["INSTALLATION_TEST"]
require "rspec/core/rake_task"
namespace :serverspec do
desc "Run serverspec on linux"
RSpec::Core::RakeTask.new(:linux) do |t|
t.pattern = "serverspec/linux/*.rb"
end
desc "Run serverspec on windows"
RSpec::Core::RakeTask.new(:windows) do |t|
t.pattern = "serverspec/windows/*.rb"
end
desc "Run serverspec for kafka"
RSpec::Core::RakeTask.new(:kafka) do |t|
t.pattern = "serverspec/kafka/*.rb"
end
end
end