-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
99 lines (87 loc) · 2.85 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
pipeline {
/*
* Defining where to run
*/
//// Any:
// agent any
//// By agent label:
// agent { label 'sandybridge' }
agent { label 'jenkinsfile' }
triggers {
pollSCM('H/10 * * * *')
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '50'))
timestamps()
}
stages {
stage ('build') {
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
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"
mkdir -p build
cd build && rm -rf ./*
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/installdir -DPOLAR_TESTING:BOOL=ON -DEXTRA_LIBS="ifcore"
# build
make
# install
make install
'''
}
}
stage ('test') {
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
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
'''
}
}
stage ('package') {
steps {
sh 'cd build && make package'
archiveArtifacts allowEmptyArchive: true, artifacts: 'build/POLAR-3.0.0-Linux.tar.gz'
}
}
}
// 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']]
}
}
}