forked from flatironinstitute/CaImAn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
144 lines (138 loc) · 4.62 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
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
pipeline {
agent none
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '10', daysToKeepStr: '15'))
timeout(time: 2, unit: 'HOURS')
retry(3)
timestamps()
}
stages {
stage('test') {
parallel {
stage('linux-python2') {
agent {
dockerfile {
dir "test/linux-python2"
args '-v /etc/passwd:/etc/passwd -v /etc/group:/etc/group -v /home/jenkins/.conda2/pkgs:/home/jenkins/.conda/pkgs:rw,z'
}
}
environment {
CONDA_ENV = "${env.WORKSPACE}/test/${env.STAGE_NAME}"
}
steps {
sh 'conda env create -q -f environment_python2.yml -p $CONDA_ENV'
sh '''#!/bin/bash -ex
source $CONDA_ENV/bin/activate $CONDA_ENV
pip install .
TEMPDIR=$(mktemp -d)
export CAIMAN_DATA=$TEMPDIR/caiman_data
cd $TEMPDIR
caimanmanager.py install
nosetests --traverse-namespace caiman
caimanmanager.py demotest
'''
}
}
stage('linux-python3') {
agent {
dockerfile {
dir "test/linux-python3"
args '-v /etc/passwd:/etc/passwd -v /etc/group:/etc/group -v /home/jenkins/.conda3/pkgs:/home/jenkins/.conda/pkgs:rw,z'
}
}
environment {
CONDA_ENV = "${env.WORKSPACE}/test/${env.STAGE_NAME}"
}
steps {
sh 'conda env create -q -f environment.yml -p $CONDA_ENV'
sh '''#!/bin/bash -ex
source $CONDA_ENV/bin/activate $CONDA_ENV
pip install .
TEMPDIR=$(mktemp -d)
export CAIMAN_DATA=$TEMPDIR/caiman_data
cd $TEMPDIR
caimanmanager.py install
nosetests --traverse-namespace caiman
caimanmanager.py demotest
'''
}
}
stage('osx-python2') {
agent {
label 'osx && anaconda2'
}
environment {
CONDA_ENV = "${env.WORKSPACE}/test/${env.STAGE_NAME}"
}
steps {
sh '$ANACONDA2/bin/conda env create -q -f environment_python2.yml -p $CONDA_ENV'
sh '''#!/bin/bash -ex
source $ANACONDA2/bin/activate $CONDA_ENV
pip install .
TEMPDIR=$(mktemp -d)
export CAIMAN_DATA=$TEMPDIR/caiman_data
cd $TEMPDIR
caimanmanager.py install
nosetests --traverse-namespace caiman
'''
}
}
stage('osx-python3') {
agent {
label 'osx && anaconda3'
}
environment {
CONDA_ENV = "${env.WORKSPACE}/test/${env.STAGE_NAME}"
LANG = "en_US.UTF-8"
}
steps {
sh '$ANACONDA3/bin/conda env create -q -f environment.yml -p $CONDA_ENV'
sh '''#!/bin/bash -ex
source $ANACONDA3/bin/activate $CONDA_ENV
pip install .
TEMPDIR=$(mktemp -d)
export CAIMAN_DATA=$TEMPDIR/caiman_data
cd $TEMPDIR
caimanmanager.py install
nosetests --traverse-namespace caiman
'''
}
}
/* stage('win-python3') {
agent {
label 'windows && anaconda3'
}
environment {
ANACONDA = "C:\\ProgramData\\Anaconda3"
CONDA_ENV = "${env.WORKSPACE}\\test\\${env.STAGE_NAME}"
}
steps {
bat '%ANACONDA%\\scripts\\conda info'
bat '%ANACONDA%\\scripts\\conda env create -q -f environment.yml -p %CONDA_ENV%'
bat '%CONDA_ENV%\\scripts\\activate %CONDA_ENV% && pip install . && copy caimanmanager.py %TEMP% && cd %TEMP% && set "CAIMAN_DATA=%TEMP%\\caiman_data" && (if exist caiman_data (rmdir caiman_data /s /q) else (echo "Host is fresh")) && python caimanmanager.py install && python caimanmanager.py test'
}
} */
}
}
}
post {
failure {
emailext subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS',
body: '''$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS
Check console output at $BUILD_URL to view full results.
Building $BRANCH_NAME for $CAUSE
$JOB_DESCRIPTION
Chages:
$CHANGES
End of build log:
${BUILD_LOG,maxLines=60}
''',
recipientProviders: [
[$class: 'DevelopersRecipientProvider'],
],
replyTo: '$DEFAULT_REPLYTO',
to: 'epnevmatikakis@gmail.com, andrea.giovannucci@gmail.com, pgunn@flatironinstitute.org'
}
}
}