Skip to content

Commit 84aaff2

Browse files
author
diogorac
committed
improv Jenkinsfile
1 parent 57c5aee commit 84aaff2

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

Jenkinsfile

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
node('builder'){
22
docker.image('riddleandcode/wallet-builder').inside('-u "root"') {
3-
checkout scm
4-
stage('Generating build') {
5-
sh 'mkdir -p build && cd build && cmake ../'
6-
}
7-
stage('Coding Guideline') {
8-
sh 'astyle "src/*.c" "inc/*.h" "tests/*.c" "tests/*.h" --style=google -s2'
9-
sh 'echo \'if [ $(find . -iname "*.orig" | wc -l) -eq 0 ]; then echo "According to guideline."; else echo "Not according to guideline" && exit 1; fi\' > guide && sh guide'
10-
}
11-
dir('build')
12-
{
13-
stage('Build') {
14-
sh 'make'
3+
try {
4+
checkout scm
5+
stage('Generating build') {
6+
sh 'mkdir -p build && cd build && cmake ../'
7+
}
8+
stage('Coding Guideline') {
9+
sh 'astyle "src/*.c" "inc/*.h" "tests/*.c" "tests/*.h" --style=google -s2'
10+
sh 'echo \'if [ $(find . -iname "*.orig" | wc -l) -eq 0 ]; then echo "According to guideline."; else echo "Not according to guideline" && exit 1; fi\' > guide && sh guide'
1511
}
16-
stage('Testing') {
17-
sh 'make check'
18-
sh 'xsltproc /opt/ctest/ctest2junix.xsl tests/Testing/$(head -1 tests/Testing/TAG)/Test.xml > CTestResults.xml '
19-
junit 'CTestResults.xml'
20-
cobertura coberturaReportFile: 'coverage.xml'
12+
dir('build')
13+
{
14+
stage('Build') {
15+
sh 'make'
16+
}
17+
stage('Testing') {
18+
sh 'make check'
19+
sh 'xsltproc /opt/ctest/ctest2junix.xsl tests/Testing/$(head -1 tests/Testing/TAG)/Test.xml > CTestResults.xml '
20+
junit 'CTestResults.xml'
21+
cobertura coberturaReportFile: 'coverage.xml'
22+
}
2123
}
2224
}
25+
catch (error) {
26+
echo "The pipeline failed"
27+
throw error
28+
}
29+
finally {
30+
sh "git clean -xfd"
31+
}
2332
}
2433
}

0 commit comments

Comments
 (0)