forked from ASNeG/OpcUaStack
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
56 lines (49 loc) · 2.18 KB
/
Jenkinsfile
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
pipeline {
agent any
stages {
stage('cppcheck') {
steps {
sh 'cppcheck --xml --xml-version=2 ./src 2> cppcheck.xml'
}
}
stage('build') {
parallel {
stage('build_linux') {
steps {
sh 'docker-compose build'
sh 'docker-compose run stack sh build.sh -t tst -j 2 -B Release --test-with-server opc.tcp://demo_server:8889'
}
}
stage('build_windows') {
steps {
script {
sh('basename $PWD > DIRNAME.txt')
env.BUILDDIRNAME = 'C:\\build\\' + readFile('DIRNAME.txt').trim()
}
sh 'ssh 127.0.0.1 -l vagrant -p 2222 "cd $BUILDDIRNAME && C:\\build_vs.bat -t local -B Release -i $BUILDDIRNAME\\.ASNeG -vs \\"Visual Studio 15 2017 Win64\\" -j 2"'
sh 'ssh 127.0.0.1 -l vagrant -p 2222 "cd $BUILDDIRNAME && C:\\build_vs.bat -t tst -B Release -s $BUILDDIRNAME\\.ASNeG -vs \\"Visual Studio 15 2017 Win64\\" -j 2"'
}
}
}
}
stage('test_linux') {
steps {
sh 'docker-compose run -w /OpcUaStack/build_tst_Release stack ./OpcUaStackCoreTest --log_format=XML --log_sink=core_results.xml --log_level=all --report_level=no'
sh 'docker-compose run -w /OpcUaStack/build_tst_Release stack ./OpcUaStackServerTest --log_format=XML --log_sink=server_results.xml --log_level=all --report_level=no'
sh 'docker-compose run -w /OpcUaStack/build_tst_Release stack ./OpcUaStackClientTest --log_format=XML --log_sink=client_results.xml --log_level=all --report_level=no'
}
}
}
post {
always {
sh 'docker-compose run -w /OpcUaStack/build_tst_Release stack cat core_results.xml > core_results.xml || true'
sh 'docker-compose run -w /OpcUaStack/build_tst_Release stack cat server_results.xml > server_results.xml || true'
sh 'docker-compose run -w /OpcUaStack/build_tst_Release stack cat client_results.xml > client_results.xml || true'
xunit (
thresholds: [ skipped(failureThreshold: '0'), failed(failureThreshold: '0') ],
tools: [ BoostTest(pattern: '*_results.xml') ])
sh 'docker-compose down --volumes'
sh 'vagrant halt'
}
}
}