-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcromwell_install.sh
executable file
·73 lines (57 loc) · 2.16 KB
/
cromwell_install.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
#!/bin/bash
# script: cromwell_install.sh
# Aim: install cromwell version X in one GO
#
# Stéphane Plaisance - VIB-Nucleomics Core - 2019-09-20 v1.0
# now finds the latest release automatically 2020-05-04 v1.1
#
# visit our Git: https://github.com/Nucleomics-VIB
######################################
## get destination folder from user ##
function latest_git_release() {
# argument is a quoted string like "broadinstitute/cromwell"
ID=${GITHUB_ID}
TOKEN=${GITHUB_TOKEN}
curl --silent -u ${GITHUB_ID}:${GITHUB_TOKEN} "https://api.github.com/repos/$1/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'
}
mybuild=$(latest_git_release "broadinstitute/cromwell")
echo "# Installing the current Cromwell release : ${mybuild}"
echo -n "[ENTER] for '/opt/biotools' or provide a different path: "
read -r mypath
biotools=${mypath:-"/opt/biotools"}
# test if exists and abort
if [ ! -d "${biotools}" ]; then
echo "# This path was not found, check it and restart this script."
exit 0
fi
# get the jar
cromwell="${biotools}/cromwell"
mkdir -p "${cromwell}" && ( cd "${cromwell}" || return )
# https://github.com/broadinstitute/cromwell/releases/download/46/cromwell-46.jar
# https://github.com/broadinstitute/cromwell/releases/download/46/womtool-46.jar
# check if already there and delete
if [ -f "cromwell-${mybuild}.jar" ]; then
rm "cromwell-${mybuild}.jar"
fi
if [ -f "womtool-${mybuild}.jar" ]; then
rm "womtool-${mybuild}.jar"
fi
# get fresh
wget "https://github.com/broadinstitute/cromwell/releases/download/${mybuild}/cromwell-${mybuild}.jar" && \
ln -f -s "cromwell-${mybuild}.jar" cromwell.jar
# test for success
if [ $? -ne 0 ] ; then
echo "# cromwell.jar was not found online"
fi
wget "https://github.com/broadinstitute/cromwell/releases/download/${mybuild}/womtool-${mybuild}.jar" && \
ln -f -s "womtool-${mybuild}.jar" womtool.jar
# test for success
if [ $? -ne 0 ] ; then
echo "# womtool.jar was not found online"
fi
cd ../
# print version
echo
echo "# if all went right, you should see the new Cromwell and womtool versions below"
java -jar "${cromwell}/cromwell.jar" --version
java -jar "${cromwell}/womtool.jar" --version