-
Notifications
You must be signed in to change notification settings - Fork 13
/
Jenkinsfile
88 lines (86 loc) · 2.04 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!groovy
// Jenkinsfile for compiling, testing, and packaging the Dashel libraries.
// Requires CMake plugin from https://github.com/davidjsherman/aseba-jenkins.git in global library.
pipeline {
agent any // use any available Jenkins agent
stages {
stage('Prepare') {
steps {
checkout scm
}
}
stage('Compile') {
parallel {
stage("Compile on debian") {
agent {
label 'debian'
}
steps {
CMake([label: 'debian', getCmakeArgs: '-DBUILD_SHARED_LIBS:BOOL=OFF'])
stash includes: 'dist/**', name: 'dist-debian'
stash includes: 'build/**', name: 'build-debian'
}
}
stage("Compile on macos") {
agent {
label 'macos'
}
steps {
CMake([label: 'macos', getCmakeArgs: '-DBUILD_SHARED_LIBS:BOOL=OFF'])
stash includes: 'dist/**', name: 'dist-macos'
}
}
stage("Compile on windows") {
agent {
label 'windows'
}
steps {
CMake([label: 'windows', getCmakeArgs: '-DBUILD_SHARED_LIBS:BOOL=OFF'])
stash includes: 'dist/**', name: 'dist-windows'
}
}
}
}
stage('Test') {
parallel {
stage("Test on debian") {
agent {
label 'debian'
}
steps {
unstash 'build-debian'
dir('build/debian') {
sh 'LANG=C ctest'
}
}
}
}
}
stage('Package') {
parallel {
stage("Build debian package") {
agent {
label 'debian'
}
steps {
dir('build/debian/package') {
// We must rebuild in a subdirectory to prevent debuild from polluting the workspace parent
sh 'git clone --depth 1 --single-branch $GIT_URL'
sh '(cd dashel && which debuild && debuild -i -us -uc -b)'
sh 'mv libdashel*.deb libdashel*.changes libdashel*.build $WORKSPACE/dist/debian/'
}
stash includes: 'dist/**', name: 'dist-debian'
}
}
}
}
stage('Archive') {
steps {
unstash 'dist-debian'
unstash 'dist-macos'
unstash 'dist-windows'
archiveArtifacts artifacts: 'dist/**', fingerprint: true, onlyIfSuccessful: true
}
}
}
}