forked from e0404/matRad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
60 lines (57 loc) · 1.81 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
node {
def osName
stage('Set Environment') {
echo 'Setting the environment..'
checkout scm
if (isUnix()) {
def uname = sh script: 'uname', returnStdout: true
if (uname.startsWith("Darwin")) {
osName= "Macos"
sh label: '', script: 'chmod +x ./submodules/MCsquare/MCsquare_mac'
sh label: '', script: 'chmod +x runtests.sh'
}
else {
osName= "Linux"
sh label: '', script: 'chmod +x ./submodules/MCsquare/MCsquare_linux'
sh label: '', script: 'chmod +x runtests.sh'
}
}
else {
osName= "Windows"
}
}
stage('Test with MATLAB')
{
echo 'Testing on MATLAB..'
echo 'Make sure you can run matlab script from the command line'
if (osName == "Windows") {
bat label: '', script: 'matlab -noFigureWindow -nosplash -minimize -wait -r "cd unitTest; matRad_runTests"'
}
else {
sh label: '', script: 'matlab -nodisplay -r "cd unitTest; matRad_runTests"'
}
}
stage('Test with Octave')
{
echo 'Testing on Octave..'
if (osName == "Windows") {
bat label: '', script: './runtests.sh octave-cli'
}
else {
sh label: '', script: './runtests.sh octave-cli'
}
}
stage('Build') {
echo 'Building....'
if (osName == "Windows") {
bat label: '', script: 'matlab -nodisplay -r "matRad_compileStandalone"'
}
else {
sh label: '', script: 'matlab -nodisplay -r "matRad_compileStandalone"'
}
}
stage('Archive') {
echo 'Archiving....'
archiveArtifacts artifacts: 'standalone/for_redistribution/matRad_installer*', onlyIfSuccessful: true
}
}