-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
105 lines (94 loc) · 3.35 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
pipeline {
/*
* Defining where to run
*/
//// Any:
// agent any
//// By agent label:
// agent { label 'sandybridge' }
// no agents, each stage must declare it
agent none
triggers {
pollSCM('H/10 * * * *')
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '50'))
timestamps()
}
stages {
stage ('polar-build') {
agent { label "jenkinsfile" }
steps {
sh '''#!/bin/bash -le
# loads modules
module purge
module load cmake/3.9.6
module load intel/2017
module load intelmpi/2017/intel-2017
module load elpa/2015.11.001-intel-2017
set -x
module list
export CC=icc # just in case
export FC=ifort # just in case
export F90=ifort # just in case
export I_MPI_CC="$CC"
export I_MPI_FC="$FC"
export I_MPI_F90="$F90"
# POLAR
wget -q "http://ecrcwiki.kaust.edu.sa:8080/job/ecrcrepo/job/polar/job/master/lastSuccessfulBuild/artifact/build/POLAR-3.0.0-Linux.tar.gz" -O - | tar -zx
POLARDIR=$PWD/POLAR-3.0.0-Linux
# build
mkdir -p build
cd build && rm -rf ./*
export I_MPI_CC="icc"
export I_MPI_F90="ifort"
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/installdir -DKSVD_TESTING:BOOL=ON -DEXTRA_LIBS="ifcore" -DPOLAR_DIR=$POLARDIR
# build
make
# install
make install
'''
stash name: "build-polar", includes: "build/**"
}
}
stage ('polar-test') {
agent { label "jenkinsfile" }
steps {
unstash 'build-polar'
sh '''#!/bin/bash -le
# loads modules
module purge
module load cmake/3.9.6
module load intel/2017
module load intelmpi/2017/intel-2017
module load elpa/2015.11.001-intel-2017
set -x
module list
# Delete previous CTest results and run tests
rm -rf $WORKSPACE/build/Testing
cd $WORKSPACE/build
export PATH=$PATH:.
ctest --no-compress-output -T Test
'''
}
}
}
// Post build actions
post {
//always {
//}
//success {
//}
//unstable {
//}
//failure {
//}
unstable {
emailext body: "${env.JOB_NAME} - Please go to ${env.BUILD_URL}", subject: "Jenkins Pipeline build is UNSTABLE", recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']]
}
failure {
emailext body: "${env.JOB_NAME} - Please go to ${env.BUILD_URL}", subject: "Jenkins Pipeline build FAILED", recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']]
}
}
}