-
Notifications
You must be signed in to change notification settings - Fork 24
/
installlatest.sh
83 lines (60 loc) · 2.41 KB
/
installlatest.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
79
80
81
82
83
#!/bin/bash
#example usage:
#bash installlatest.sh
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'
}
wget https://raw.githubusercontent.com/DataIntellectTech/TorQ/master/installtorqapp.sh
torq_latest=`get_latest_release "DataIntellectTech/TorQ"`
if [[ $torq_latest == *?.?.? ]] || [[ $torq_latest == *?.??.?? ]] || [[ $torq_latest == *?.?.?? ]] || [[ $torq_latest == *?.??.? ]];
then
echo "============================================================="
echo "Latest TorQ release"
echo $torq_latest
echo "Getting the latest TorQ .tar.gz file"
echo "============================================================="
else
echo "the tag for Torq release: "
echo $torq_latest
echo "Is not in the right format, exiting script."
exit 1
fi
wget --content-disposition https://github.com/DataIntellectTech/TorQ/archive/$torq_latest.tar.gz
echo $torq_latest
if [ "${torq_latest%%v*}" ]
then
echo "tag doesn't start with v"
else
torq_latest=${torq_latest#?}
fi
echo $torq_latest
torq_fsp_latest=`get_latest_release "DataIntellectTech/TorQ-Finance-Starter-Pack"`
echo "============================================================="
echo "Latest TorQ-FSP release"
echo $torq_fsp_latest
echo "Getting the latest TorQ-FSP .tar.gz file"
echo "============================================================="
if [[ $torq_fsp_latest == *?.?.? ]] || [[ $torq_fsp_latest == *?.??.?? ]] || [[ $torq_fsp_latest == *?.??.? ]] || [[ $torq_fsp_latest == *?.?.?? ]];
then
echo "============================================================="
echo "Latest TorQ-FSP release"
echo $torq_fsp_latest
echo "Getting the latest TorQ-FSP .tar.gz file"
echo "============================================================="
else
echo "the tag for Torq release: "
echo $torq_fsp_latest
echo "Is not in the right format, exiting script."
exit 1
fi
wget --content-disposition https://github.com/DataIntellectTech/TorQ-Finance-Starter-Pack/archive/$torq_fsp_latest.tar.gz
echo $torq_fsp_latest
if [ "${torq_fsp_latest%%v*}" ]
then
echo "tag doesn't start with v"
else
torq_fsp_latest=${torq_fsp_latest#?}
fi
echo $torq_fsp_latest
echo "Files downloaded. Executing install script"
bash installtorqapp.sh --torq TorQ-$torq_latest.tar.gz --releasedir deploy --data datatemp --installfile TorQ-Finance-Starter-Pack-$torq_fsp_latest.tar.gz