forked from OpenSpace/OpenSpace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
166 lines (154 loc) · 4.18 KB
/
Jenkinsfile
File metadata and controls
166 lines (154 loc) · 4.18 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
import groovy.io.FileType
library('sharedSpace'); // jenkins-pipeline-lib
def url = 'https://github.com/OpenSpace/OpenSpace';
def branch = env.BRANCH_NAME;
@NonCPS
def readDir() {
def dirsl = [];
new File("${workspace}").eachDir() {
dirs -> println dirs.getName()
if (!dirs.getName().startsWith('.')) {
dirsl.add(dirs.getName());
}
}
return dirs;
}
def moduleCMakeFlags() {
def modules = [];
// using new File doesn't work as it is not allowed in the sandbox
if (isUnix()) {
modules = sh(returnStdout: true, script: 'ls -d modules/*').trim().split('\n');
};
else {
modules = bat(returnStdout: true, script: '@dir modules /b /ad /on').trim().split('\r\n');
}
// def dirs = readDir();
// def currentDir = new File('.')
// def dirs = []
// currentDir.eachFile FileType.DIRECTORIES, {
// dirs << it.name
// }
// def moduleFlags = [
// 'atmosphere',
// 'base',
// // 'cefwebgui',
// 'debugging',
// 'digitaluniverse',
// 'fieldlines',
// 'fieldlinessequence',
// 'fitsfilereader',
// 'gaia',
// 'galaxy',
// 'globebrowsing',
// 'imgui',
// 'iswa',
// 'kameleon',
// 'kameleonvolume',
// 'multiresvolume',
// 'server',
// 'space',
// 'spacecraftinstruments',
// 'space',
// 'spout',
// 'sync',
// 'touch',
// 'toyvolume',
// 'volume',
// // 'webbrowser',
// // 'webgui'
// ];
def flags = '';
for (module in modules) {
flags += "-D OPENSPACE_MODULE_${module.toUpperCase()}=ON "
}
return flags;
}
// echo flags
//
// Pipeline start
//
parallel master: {
node('master') {
stage('master/scm') {
deleteDir();
gitHelper.checkoutGit(url, branch);
helper.createDirectory('build');
}
stage('master/cppcheck/create') {
sh 'cppcheck --enable=all --xml --xml-version=2 -i ext --suppressions-list=support/cppcheck/suppressions.txt include modules src tests 2> build/cppcheck.xml';
}
stage('master/cloc/create') {
sh 'cloc --by-file --exclude-dir=build,data,ext --xml --out=build/cloc.xml --force-lang-def=support/cloc/langDef --quiet .';
}
}
},
linux: {
node('linux') {
stage('linux/scm') {
deleteDir()
gitHelper.checkoutGit(url, branch);
}
stage('linux/build') {
// Not sure why the linking of OpenSpaceTest takes so long
compileHelper.build(compileHelper.Make(), compileHelper.Gcc(), moduleCMakeFlags(), 'OpenSpace', 'build-all');
}
stage('linux/warnings') {
// compileHelper.recordCompileIssues(compileHelper.Gcc());
}
stage('linux/test') {
// testHelper.runUnitTests('build/OpenSpaceTest');
}
} // node('linux')
},
windows: {
node('windows') {
ws("${env.JENKINS_BASE}/O/${env.BRANCH_NAME}/${env.BUILD_ID}") {
stage('windows/scm') {
deleteDir();
gitHelper.checkoutGit(url, branch);
}
stage('windows/build') {
compileHelper.build(compileHelper.VisualStudio(), compileHelper.VisualStudio(), moduleCMakeFlags(), '', 'build-all');
}
stage('windows/warnings') {
// compileHelper.recordCompileIssues(compileHelper.VisualStudio());
}
stage('windows/test') {
// Currently, the unit tests are failing on Windows
// testHelper.runUnitTests('bin\\Debug\\OpenSpaceTest')
}
} // node('windows')
}
},
osx: {
node('osx') {
stage('osx/scm') {
deleteDir();
gitHelper.checkoutGit(url, branch);
}
stage('osx/build') {
compileHelper.build(compileHelper.Xcode(), compileHelper.Clang(), moduleCMakeFlags(), '', 'build-all');
}
stage('osx/warnings') {
// compileHelper.recordCompileIssues(compileHelper.Clang());
}
stage('osx/test') {
// Currently, the unit tests are crashing on OS X
// testHelper.runUnitTests('build/Debug/OpenSpaceTest')
}
} // node('osx')
}
//
// Post-build actions
//
node('master') {
stage('master/cppcheck/publish') {
// publishCppcheck(pattern: 'build/cppcheck.xml');
}
stage('master/cloc/publish') {
sloccountPublish(encoding: '', pattern: 'build/cloc.xml');
}
stage('master/notifications') {
slackHelper.sendChangeSetSlackMessage(currentBuild);
}
}