-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathJenkinsfile
62 lines (56 loc) · 1.83 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
57
58
59
60
61
62
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timeout(time: 1, unit: 'HOURS')
}
parameters {
booleanParam name: 'RUN_BUILD', defaultValue: true, description: 'Run build process?'
booleanParam name: 'RUN_FUZZ', defaultValue: true, description: 'Run fuzz process?'
booleanParam name: 'RUN_REPORT', defaultValue: true, description: 'Run report process?'
}
stages {
stage('Build') {
when {
expression { params.RUN_BUILD == true }
}
steps {
checkout([
$class: 'GitSCM',
branches: [[name: 'feature-demo-afl']],
extensions: [],
userRemoteConfigs: [[url: 'https://github.com/cfanatic/vsomeip-fuzzing']],
])
sh 'docker build -t vsomeip-fuzzing .'
sh 'docker run -t -d --name vsomeip-fuzz vsomeip-fuzzing bash'
}
}
stage('Fuzz') {
when {
expression { params.RUN_FUZZ == true }
}
steps {
sh 'docker exec vsomeip-fuzz ../misc/runtime.sh -fuzz 10'
}
}
stage('Report') {
when {
expression { params.RUN_REPORT == true }
}
steps {
sh 'docker exec vsomeip-fuzz ../misc/runtime.sh -report'
}
}
}
post {
success {
sh 'rm -rf afl_output'
sh 'docker cp vsomeip-fuzz:/src/vsomeip-fuzzing/build/afl_output .'
zip archive: true, dir: 'afl_output', exclude: '', glob: '', overwrite: true, zipFile: "report_${env.BUILD_ID}.zip"
}
cleanup {
sh 'docker stop vsomeip-fuzz'
sh 'docker rm vsomeip-fuzz'
}
}
}