-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
142 lines (136 loc) · 4.27 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
pipeline {
agent none
options {
disableConcurrentBuilds()
timeout(time: 1, unit: 'HOURS')
}
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.yml -p $CONDA_ENV'
sh '''#!/bin/bash -ex
source $CONDA_ENV/bin/activate $CONDA_ENV
python setup.py build_ext -i
nosetests
'''
}
}
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
python setup.py build_ext -i
nosetests
'''
}
}
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_mac.yml -p $CONDA_ENV'
sh '''#!/bin/bash -ex
source $CONDA_ENV/bin/activate $CONDA_ENV
conda install -q -c conda-forge tensorflow keras
python setup.py build_ext -i
#nosetests
cd caiman/tests
nosetests $(for f in test_*.py ; do echo ${f%.py} ; done)
'''
}
}
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 $CONDA_ENV/bin/activate $CONDA_ENV
python setup.py build_ext -i
#nosetests
cd caiman/tests
nosetests $(for f in test_*.py ; do echo ${f%.py} ; done)
'''
}
}
/*
stage('win-python2') {
agent {
label 'windows && anaconda2'
}
environment {
ANACONDA = "C:\\ProgramData\\Anaconda2"
CONDA_ENV = "${env.WORKSPACE}\\test\\${env.STAGE_NAME}"
}
steps {
bat '%ANACONDA%\\scripts\\conda env create -q -f environment_mac.yml -p %CONDA_ENV%'
bat '%CONDA_ENV%\\scripts\\activate %CONDA_ENV% && python setup.py build_ext -i && nosetests'
}
}
*/
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 env create -q -f environment.yml -p %CONDA_ENV%'
bat '%CONDA_ENV%\\scripts\\activate %CONDA_ENV% && python setup.py build_ext -i && nosetests'
}
}
}
}
}
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'
}
}
}