-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline.groovy
47 lines (40 loc) · 1.42 KB
/
pipeline.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
import hudson.FilePath
import hudson.model.*
def findClonedRepos(manager){
def lines = manager.build.logFile.readLines()
def result = lines.findAll{it.contains("scaffe")}
manager.listener.logger.println(result.toString());
manager.listener.logger.println("---------------------");
def result_str = result.join('\n')
def fp = new FilePath(manager.build.workspace, 'result')
fp.write(result_str.toString(), null)
}
def setFailType(fail_type, type){
if (!fail_type.isEmpty()) {
if (!fail_type.contains(type)) {
fail_type += System.getProperty("line.separator") + type + ","
}
} else {
fail_type += type
}
return fail_type
}
def findFailType(manager){
def fail_type = ""
def previous_fail_type = ""
if (manager.logContains(".*Error cloning remote repo.*")) {
fail_type = setFailType(fail_type, "Git_Clone")
}
if (manager.logContains(".*NNC build \\(SCaffe\\) build failed.*")) {
fail_type = setFailType(fail_type, "SCaffe TV failure")
}
if (manager.logContains(".*Error occurred while compiling NN models NPU compiler.*")) {
fail_type = setFailType(fail_type, "Possible compile failure")
}
def fp = new FilePath(manager.build.workspace, 'fail_type')
if (fp.exists()) {
previous_fail_type = fp.readToString()
}
fail_type=setFailType(fail_type, previous_fail_type)
fp.write(fail_type, null)
}