forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInputManifest.groovy
70 lines (57 loc) · 1.57 KB
/
InputManifest.groovy
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
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
package jenkins
class InputManifest {
class Ci implements Serializable {
class Image implements Serializable {
String name
String args
Image(Map data) {
this.name = data.name
if (this.name == null) {
error("Missing ci.image.name")
}
this.args = data.args
}
}
Image image
Ci(Map data) {
this.image = new InputManifest.Ci.Image(data.image)
}
}
class Build implements Serializable {
String name
String version
String qualifier
String platform
String architecture
Build(Map data) {
this.name = data.name
this.version = data.version
this.qualifier = data.qualifier
this.platform = data.platform
this.architecture = data.architecture
}
String getFilename() {
return this.name.toLowerCase().replaceAll(' ', '-')
}
}
Build build
Ci ci
InputManifest(Map data) {
this.build = new InputManifest.Build(data.build)
this.ci = data.ci ? new InputManifest.Ci(data.ci) : null
}
String getSHAsRoot(String jobName) {
return [
jobName,
this.build.version,
'shas'
].join("/")
}
}