-
Notifications
You must be signed in to change notification settings - Fork 35
/
platforms.rb
224 lines (184 loc) · 4.06 KB
/
platforms.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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#
# We now support the same platform names that ohai uses, please
# keep this API consistent with ohai. The old "el" platform is still
# canonical for redhat, but should be considered deprecated.
#
# BASE platform classes
#
# - these are first-class platforms that we have builders and testers for
#
# NB: this platform name is deprecated, convert to using "redhat" like ohai
platform "el" do
major_only true
end
platform "debian" do
major_only true
end
platform "ubuntu"
# NB: this platform name is deprecated, convert to using "darwin" like ohai
# If we don't have an arm64 build yet, fall back to x86_64
platform "mac_os_x" do
fallback_arch "x86_64"
end
platform "solaris2"
platform "smartos" do
remap "solaris2"
version_remap "5.10"
end
# We map all the windows versions to 2008r2
platform "windows"
platform "freebsd" do
major_only true
end
platform "redhat" do
major_only true
remap "el"
end
platform "aix"
platform "nexus" do
major_only true
end
platform "ios_xr" do
major_only true
end
platform "darwin" do
remap "mac_os_x"
end
platform "sled" do
major_only true
remap "sles"
end
platform "suse" do
major_only true
remap "sles"
end
platform "opensuse-leap" do
major_only true
remap "sles"
end
platform "sles" do
major_only true
end
# Supported RHEL Variants
#
# These are RHEL clones that we know will work + SuSE that we test on
#
platform "rocky"
platform "centos" do
major_only true
remap "el"
end
platform "enterpriseenterprise" do # alias for "oracle"
major_only true
remap "el"
end
platform "oracle" do
major_only true
remap "el"
end
platform "scientific" do
major_only true
remap "el"
end
platform "amazon" do
remap do |opts|
if opts[:version] == "2"
"amazon" # Ensure Amazon Linux 2 is not mapped to "el"
elsif /201\d\.\d/.match?(opts[:version])
"el"
else
"amazon"
end
end
version_remap do |opts|
if opts[:version] == "2"
"7"
elsif /201\d\.\d/.match?(opts[:version])
"6"
else
opts[:version]
end
end
end
# platform "amazon" do
# remap do |opts|
# # map "version 1" amazon linux and amazon linux 2 to RHEL
# if /201\d\.\d/.match?(opts[:version]) || opts[:version] == "2"
# "el"
# else
# "amazon"
# end
# end
# version_remap do |opts|
# if /201\d\.\d/.match?(opts[:version])
# # map "version 1" amazon linux to RHEL 6. These are named by the year/month ubuntu style
# "6"
# elsif opts[:version] == "2"
# # map Amazon Linux 2 to RHEL 7
# "7"
# else
# opts[:version]
# end
# end
# end
# Unsupported Variants
#
platform "xenserver" do
remap "el"
major_only true
end
platform "coreos" do
remap "el"
version_remap 6
end
platform "fedora" do
remap "el"
version_remap do |opts|
# A combo of Fedora 19/20 was used to create RHEL 7 so when we're on Fedora 20 use the RHEL 7 packages
# https://docs.fedoraproject.org/quick-docs/en-US/fedora-and-red-hat-enterprise-linux.html
(opts[:version].to_i >= 20) ? "7" : "6"
end
end
platform "linuxmint" do
remap "ubuntu"
version_remap do |opts|
minor_rev = ( opts[:version].to_i % 2 == 0 ) ? "10" : "04"
major_rev = ( (opts[:version].to_i + 11) / 2 ).floor.to_s
"#{major_rev}.#{minor_rev}"
end
end
# Univention Corporate Server is predominantly used in German
# FIXME: version_remapping to correct debian version ideally needed
platform "univention" do
remap "debian"
version_remap 6
end
# this'll magically work if we ever publish ARM debian builds
platform "raspbian" do
remap "debian"
end
platform "arista_eos" do
major_only true
remap "el"
version_remap 6
end
# cumulus linux 3.0.0 and later is debian 8
platform "cumulus_linux" do
remap "debian"
version_remap do |opts|
(opts[:version].split('.')[0].to_i >= 3) ? "8" : "7"
end
end
platform "cumulus_networks" do
remap "debian"
version_remap 7
end
# these are unsupported because we have no build infrastructure for them:
# - slackware
# - arch
# - gentoo
# - debian/ubuntu/rhel ARM/PPC
# - redhat ARM/PPC
# - HPUX
# - openbsd
# - netbsd