-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkins_pipelines_regression_devel.sh
executable file
·79 lines (61 loc) · 2.27 KB
/
jenkins_pipelines_regression_devel.sh
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
#!/usr/bin/env bash
# References
# http://kvz.io/blog/2013/11/21/bash-best-practices/
# http://jvns.ca/blog/2017/03/26/bash-quirks/
# exit when a command fails
set -o errexit
# exit if any pipe commands fail
set -o pipefail
# exit when your script tries to use undeclared variables
#set -o nounset
# trace what gets executed
set -o xtrace
# configure module
unset -f module
module() { eval `/usr/bin/modulecmd bash $*`; }
# Host to run pipeline from. Jenkins must be able to SSH into there.
SUBMIT_HOST=jenkins@cgath1
export HOME=/ifs/home/jenkins
export DRMAA_LIBRARY_PATH=/ifs/apps/system/sge-6.2/lib/lx24-amd64/libdrmaa.so
export SGE_ROOT=/ifs/apps/system/sge-6.2
export SGE_CLUSTER_NAME=cgat
export SGE_ARCH=lx24_x86
export SGE_CELL=default
export MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles:/ifs/apps/modulefiles
echo "Installing pipelines"
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" ${SUBMIT_HOST} \
"cd ${WORKSPACE} && \
export TERM=xterm && \
bash install-devel.sh \
--install \
--install-pipeline-dependencies \
--use-repo ${WORKSPACE} \
--location ${WORKSPACE}/cgat-developers"
echo "Run python tests"
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" ${SUBMIT_HOST} \
"cd ${WORKSPACE} && \
export TERM=xterm && \
bash install-devel.sh \
--test \
--use-repo ${WORKSPACE} \
--location ${WORKSPACE}/cgat-developers"
# copy test configuration files
curl -O https://raw.githubusercontent.com/cgat-developers/cgat-tests/master/pipeline.yml
error_report() {
echo "Error detected"
echo "Dumping log traces of test pipelines:"
grep "ERROR" *.dir/pipeline.log
grep -A 30 "Exception" *.dir/pipeline.log
echo "Dumping error messages from pipeline_testing/pipeline.log:"
sed -n '/start of error messages$/,/end of error messages$/p' pipeline.log
}
trap 'error_report' ERR
# run pipelines
echo "Starting pipelines"
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" ${SUBMIT_HOST} \
"cd ${WORKSPACE} && \
export TERM=xterm && \
source ${WORKSPACE}/cgat-developers/conda-install/etc/profile.d/conda.sh && \
conda activate base && conda activate cgat-flow && \
module load bio/gatk-full bio/homer && \
cgatflow testing make full -v 5"