-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
54 lines (47 loc) · 1.25 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
void setBuildStatus(String message, String state) {
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/jakobod/network-driver"],
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status"],
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
]);
}
pipeline {
agent { dockerfile { additionalBuildArgs '--no-cache' } }
stages {
stage('Init') {
steps{
setBuildStatus("Building...", "PENDING");
sh 'rm -rf build'
}
}
stage('Configure') {
steps {
sh './configure --enable-testing'
}
}
stage('Build') {
steps {
dir('build') {
sh 'make'
}
}
}
stage('Test') {
steps {
dir('build') {
sh 'ctest -T test --no-compress-output --output-on-failure'
}
}
}
}
post {
success {
setBuildStatus("Build succeeded!", "SUCCESS");
}
failure {
setBuildStatus("Build failed!", "FAILURE");
}
}
}