-
Notifications
You must be signed in to change notification settings - Fork 0
/
components.groovy
85 lines (71 loc) · 3.85 KB
/
components.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
71
72
73
74
75
76
77
78
79
80
81
82
83
class ComponentsBuilder implements java.io.Serializable {
def components = [:]
def changedComponents = [:]
ComponentsBuilder() {
components["CEF"] = "Containers/Docker/shield-cef"
components["ICAP"] = "Containers/Docker/shield-icap"
components["ELK"] = "Containers/Docker/shield-elk"
components["UBUNTU"] = "Containers/Docker/secure-remote-browser-ubuntu-base"
components["NODEJS"] = "Containers/Docker/secure-remote-browser-ubuntu-nodejs-xdummy"
components["CONSUL"] = "Containers/Docker/shield-configuration"
}
def findComponent(String path) {
def lst = components.keySet() as List
for(def key in lst) {
if(path.startsWith(components[key].toString())) {
return key
}
}
return null
}
def appendComponent(String path) {
def k = findComponent(path)
if(k) {
changedComponents[k] = true
}
}
def executeBuild(String component) {
changedComponents.containsKey(component)
}
def changesList() {
changedComponents.keySet() as List
}
}
def testArray = [
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.ko-kr.txt.gz",
"Containers/Docker/shield-icap/web/AccessNow/src/accessnow.min.js.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.ja-jp.txt.gz",
"Containers/Docker/shield-icap/web/AccessNow/fonts/AvenirNextLTPro-Bold.ttf.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.de.txt.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.zh-cn.txt.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.fr.txt.gz",
"Containers/Docker/shield-icap/web/AccessNow/fonts/FontAwesome.otf.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.ru.txt.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.zh-tw.txt.gz",
"Containers/Docker/shield-icap/web/AccessNow/fonts/AvenirNextLTPro-Bold.woff.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.en-us.txt.gz",
"Containers/Docker/shield-icap/web/AccessNow/fonts/fontawesome-webfont.eot.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.it.txt.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.list.txt.gz",
"AccessNow/css/shield.css",
"Containers/Docker/shield-icap/web/AccessNow/css/accessnow.min.css",
"Containers/Docker/shield-icap/web/AccessNow/fonts/AvenirNextLTPro-Bold.svg.gz",
"Containers/Docker/shield-icap/web/AccessNow/fonts/fontawesome-webfont.svg.gz",
"Containers/Docker/shield-icap/web/AccessNow/fonts/AvenirNextLTPro-Bold.eot.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.pt-br.txt.gz",
"Containers/Docker/shield-icap/web/AccessNow/css/accessnow.min.css.gz",
"Containers/Docker/shield-icap/web/AccessNow/fonts/fontawesome-webfont.woff2.gz",
"Containers/Docker/shield-icap/web/AccessNow/fonts/fontawesome-webfont.ttf.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/dictionary.es-ar.txt.gz",
"Containers/Docker/shield-icap/web/AccessNow/src/vendor.min.js.gz",
"Containers/Docker/shield-icap/web/AccessNow/fonts/fontawesome-webfont.woff.gz",
"Containers/Docker/shield-icap/web/AccessNow/resources/lang/12Dec2012ANChineseSimplified.lang.gz",
"Containers/Docker/shield-icap/web/AccessNow/fonts/AvenirNextLTPro-Bold.min.svg.gz",
"Containers/Docker/shield-configuration/Dockerfile"
]
def builder = new ComponentsBuilder()
testArray.each {
builder.appendComponent(it)
}
println builder.executeBuild('CONSUL')
println builder.changesList()