forked from DOI-USGS/ISIS3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
132 lines (127 loc) · 4.54 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
// vim: ft=groovy
def NUM_CORES = 8
def errors = []
pipeline {
agent {
docker {
image '950438895271.dkr.ecr.us-west-2.amazonaws.com/asc-jenkins'
registryCredentialsId 'ecr:us-west-2:Jenkins-Manager-Role'
registryUrl 'https://950438895271.dkr.ecr.us-west-2.amazonaws.com'
args '--entrypoint= -v /astro_efs:/astro_efs'
}
}
environment {
ISISDATA = '/astro_efs/isis_data'
ISISTESTDATA = '/astro_efs/isis_testData'
MALLOC_CHECK_ = 1
ISISROOT = "${env.WORKSPACE}/build"
KAKADU_HEADERS = '/astro_efs/kakadu_7_9'
}
stages {
stage('Environment Setup') {
steps {
sh '''
. /home/conda/mambaforge3/etc/profile.d/conda.sh > /dev/null
echo "ISISROOT: ${ISISROOT}"
conda create -y -n isis
conda activate isis > /dev/null
conda config --env --set channel_priority flexible
conda install -c conda-forge python=3 findutils
mamba env update -f environment.yml --prune
conda activate isis
mamba install -c conda-forge git
git submodule update --init --recursive
conda list
'''
}
}
stage('Build') {
steps {
sh '''
. /home/conda/mambaforge3/etc/profile.d/conda.sh > /dev/null
conda activate isis > /dev/null
mkdir -p build install
cd build
cmake -GNinja -DJP2KFLAG=ON \
-DKAKADU_INCLUDE_DIR=${KAKADU_HEADERS} \
-Dpybindings=OFF \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
../isis
ninja -j 8 install
'''
}
}
stage('GTests') {
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh '''
. /home/conda/mambaforge3/etc/profile.d/conda.sh > /dev/null
conda activate isis > /dev/null
cd build
ctest -R '.' -E '(_app_|_unit_|_module_)' -j 8 --output-on-failure --timeout 10000
'''
}
}
}
stage('Unit Tests') {
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh '''
. /home/conda/mambaforge3/etc/profile.d/conda.sh > /dev/null
conda activate isis > /dev/null
cd build
ctest -R _unit_ -j 8 --output-on-failure
'''
}
}
}
stage('App Tests') {
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh '''
. /home/conda/mambaforge3/etc/profile.d/conda.sh > /dev/null
conda activate isis > /dev/null
cd build
ctest -R _app_ -j 8 --output-on-failure --timeout 10000
'''
}
}
}
stage('Module Tests') {
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh '''
. /home/conda/mambaforge3/etc/profile.d/conda.sh > /dev/null
conda activate isis > /dev/null
cd build
ctest -R _module_ -j 8 --output-on-failure --timeout 10000
'''
}
}
}
stage('Py Tests') {
environment {
PATH = "${env.WORKSPACE}/install/bin:${env.PATH}"
}
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh '''
. /home/conda/mambaforge3/etc/profile.d/conda.sh > /dev/null
conda activate isis > /dev/null
cd build
cd $WORKSPACE/isis/pytests
pytest .
'''
}
}
}
stage('Deploy') {
steps {
sh '''
echo "This is where deploy would happen."
'''
}
}
}
}