-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
51 lines (50 loc) · 1.5 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
pipeline {
agent {
node {
label 'CentOS8_x86_64'
}
}
environment {
condaenv = fileExists '/var/lib/jenkins/.conda/envs/mtp'
}
stages {
stage('Checkout Scm') {
steps {
git 'eolJenkins:NCAR/MTP.git'
}
}
stage('Create Conda env') {
when { expression { condaenv == 'false' }}
steps {
sh ''' # Only create if condaenv dir doesn\'t exist
/opt/local/anaconda3/bin/conda env create -f ../mtpenv.yml '''
}
}
stage('Shell script 0') {
steps {
wrap([$class: 'Xvfb', additionalOptions: '', assignedLabels: '', autoDisplayName: true, debug: true, displayNameOffset: 0, installationName: 'default', parallelBuild: true, screen: '1024x758x24', timeout: '25']) {
sh '''cd tests
# This build depends on EOL-Python. Not sure if this is the *best* way to
# do this, but it works, so for now...
export PYTHONPATH=\'/var/lib/jenkins/workspace/EOL-Python/src\'
export PATH=/opt/local/anaconda3/bin:/opt/local/anaconda3/pkgs:$PATH
eval "$(conda shell.bash hook)"
conda activate mtp
./run_tests.sh'''
}
}
}
}
post {
failure {
mail(subject: 'MTP Jenkinsfile build failed', body: 'See build console output within jenkins for details', to: '[email protected] [email protected] [email protected]')
}
}
options {
buildDiscarder(logRotator(numToKeepStr: '6'))
}
triggers {
upstream(upstreamProjects: 'EOL-Python', threshold: hudson.model.Result.SUCCESS)
pollSCM('H/5 * * * *')
}
}