-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcron-wrapper.sh
executable file
·66 lines (54 loc) · 1.65 KB
/
cron-wrapper.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
#!/bin/bash
###############################################
# Cron wrapper for testing Bioconda-recipe-gen
###############################################
##### Constants
REPO=https://github.com/Hogfeldt/bioconda_recipe_gen.git
NAME=$(basename "$REPO" .git)
CONDA_DEPS="bioconda-utils docker-py"
PACKAGES=("kallisto" "tn93" "htstream" "qfilt" "libdivsufsort" "clever-toolkit")
BASE_PATH=/home/per/bioconda_recipe_gen_cron_tests
TEST_DIR=$BASE_PATH/$(date +%Y%m%d)
META_FILE=$TEST_DIR/test_meta.txt
#####
if [ -d $TEST_DIR ]; then
exit 1
fi
cd $BASE_PATH
# TODO:
# pull latest repository
git clone $REPO
cd $NAME
# setup environment
conda create --yes -n "$NAME" python=3.6
# the line below can only be done by root on server
#conda config --add channels conda-forge
#conda config --add channels bioconda
#conda update --yes conda
source /opt/conda/bin/activate "$NAME"
conda install --yes $CONDA_DEPS
# install software
python setup.py develop
git clone https://github.com/bioconda/bioconda-recipes
mkdir $TEST_DIR
echo git_commit_sha: $(git rev-parse HEAD) >> $META_FILE
echo start_time: $(date) >> $META_FILE
# run all cases and save the result of each case.
for package in ${PACKAGES[*]}
do
./travis/test.sh $package &> $TEST_DIR/$package.out
status=$? # store exit code
if [ $status -eq 0 ]; then
echo "$package build succeded" >> $META_FILE
else
echo "$package build failed" >> $META_FILE
fi
done
echo end_time: $(date) >> $META_FILE
# send mail with result
# Clean up environment
conda deactivate
conda env remove --yes --name "$NAME"
# Remove bioconda_recipe_gen
cd $BASE_PATH
rm -rf "$NAME"