-
Notifications
You must be signed in to change notification settings - Fork 0
/
nightly_build.sh
executable file
·42 lines (35 loc) · 1.42 KB
/
nightly_build.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
#!/bin/bash -l
cd /home/foueri01/ENCODExplorerDataBuild
dt=$(date '+%Y-%m-%dGMT%H:%M:%S');
mkdir $dt
pushd $dt
module load R/R-3.6.0_BioC-3.9
R --vanilla <<'EOF' 1> stdout.log 2> stderr.log
#BiocManager::install("ENCODExplorerData", version="devel", update=TRUE, ask=FALSE)
BiocManager::install("ENCODExplorerData", update=TRUE, ask=FALSE)
library(ENCODExplorerData)
source(system.file("scripts/make-data.R", package="ENCODExplorerData"))
EOF
popd
if [ ! -e $dt/encode_df_full.rda ]
then
echo "ENCODExplorerData build failed." | mail -s "ENCODExplorerData weekly build failure." \
-r encodexplorerdata@ls31.genome.ulaval.ca \
-a $dt/stdout.log -a $dt/stderr.log \
fournier.eric.2@crchudequebec.ulaval.ca \
charles.joly-beauparlant@crchudequebec.ulaval.ca
exit
fi
# Get the last two checksums
second_to_last=`ls -d *GMT*/ | sort | tail -n 2 | head -n 1`
last_md5=`md5sum $dt/encode_df_full.rda | awk '{print $1}'`
second_to_last_md5=`md5sum $second_to_last/encode_df_full.rda | awk '{print $1}'`
# If there was no change since last time, remove the directory.
if [ "$last_md5" = "$second_to_last_md5" ]
then
rm -r $dt
else
rm -rf /home/foueri01/public_html/ENCODExplorerData/latest
ln -s /home/foueri01/ENCODExplorerDataBuild/$dt /home/foueri01/public_html/ENCODExplorerData/latest
ln -s /home/foueri01/ENCODExplorerDataBuild/$dt /home/foueri01/public_html/ENCODExplorerData/$dt
fi