-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
89 lines (75 loc) · 2.55 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
def specToLabel(Map spec) {
return "${spec.os}-${spec.arch}-${spec.compiler}-FairSoft_dev"
}
def jobMatrix(String prefix, List specs, Closure callback) {
def nodes = [:]
for (spec in specs) {
def label = specToLabel(spec)
def os = spec.os
def compiler = spec.compiler
nodes["${prefix}/${label}"] = {
node(label) {
githubNotify(context: "${prefix}/${label}", description: 'Building ...', status: 'PENDING')
try {
checkout scm
if(fileExists('spack')) {
} else {
sh 'git clone https://github.com/FairRootGroup/spack.git'
}
REPO = sh(
script: './spack/bin/spack repo list | grep $WORKSPACE',
returnStdout: true
)
if(REPO.contains('fairsoft')) {
} else {
sh './spack/bin/spack repo add $WORKSPACE'
}
sh './spack/bin/spack compilers'
sh 'echo "#\n" > Dart.cfg'
if (os =~ /Debian8/ && compiler =~ /gcc8/) {
sh '''\
echo "source /etc/profile.d/modules.sh" >> Dart.cfg
echo "module use /cvmfs/it.gsi.de/modulefiles" >> Dart.cfg
echo "module load compiler/gcc/8.1.0" >> Dart.cfg
echo "export DDS_LD_LIBRARY_PATH=/cvmfs/it.gsi.de/compiler/gcc/8.1.0/lib64" >> Dart.cfg
'''
}
sh '''\
echo "export SPACK_DIR=$WORKSPACE/spack" >> Dart.cfg
echo "export FAIRROOT_VERSION=18.2.1" >> Dart.cfg
echo "export BUILDDIR=$PWD/build" >> Dart.cfg
echo "export SOURCEDIR=$PWD" >> Dart.cfg
echo "export GIT_BRANCH=$JOB_BASE_NAME" >> Dart.cfg
'''
sh 'cat Dart.cfg'
callback.call(spec, label)
githubNotify(context: "${prefix}/${label}", description: 'Success', status: 'SUCCESS')
} catch (e) {
githubNotify(context: "${prefix}/${label}", description: 'Error', status: 'ERROR')
throw e
}
}
}
}
return nodes
}
pipeline {
agent none
stages {
stage("Run CI Matrix") {
steps{
script {
def build_jobs = jobMatrix('alfa-ci/build', [
[os: 'Debian8', arch: 'x86_64', compiler: 'gcc8.1.0'],
[os: 'MacOS10.13', arch: 'x86_64', compiler: 'AppleLLVM10.0.0'],
[os: 'MacOS10.14', arch: 'x86_64', compiler: 'AppleLLVM10.0.0'],
]) { spec, label ->
sh './Dart.sh Experimental Dart.cfg'
}
parallel(build_jobs)
}
}
}
}
}