Skip to content

Commit 9f24aab

Browse files
committed
Поправил Jenkinsfile для возможности получения результатов тестирования на Jenkins
1 parent b6f45bd commit 9f24aab

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Jenkinsfile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
pipeline {
32
agent none
43
options {
@@ -19,8 +18,13 @@ pipeline {
1918
bat 'chcp 65001 > nul && opm install tool1cd'
2019

2120
if( fileExists ('tasks/test.os') ){
22-
bat 'chcp 65001 > nul && oscript tasks/test.os'
23-
junit 'tests.xml'
21+
try {
22+
cmd("oscript tasks/test.os")
23+
junit 'tests.xml'
24+
} catch (Exception err) {
25+
junit 'tests.xml'
26+
throw err;
27+
}
2428
}
2529
else
2630
echo 'no testing task'
@@ -93,3 +97,11 @@ pipeline {
9397
}
9498
}
9599
}
100+
101+
def cmd(command) {
102+
if (isUnix()) {
103+
sh "${command}"
104+
} else {
105+
bat "chcp 65001\n${command}"
106+
}
107+
}

0 commit comments

Comments
 (0)