|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +#example usage: |
| 4 | +#bash installlatest.sh |
| 5 | + |
| 6 | +get_latest_release() { |
| 7 | + curl --silent "https://api.github.com/repos/$1/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' |
| 8 | +} |
| 9 | + |
| 10 | +wget https://raw.githubusercontent.com/AquaQAnalytics/TorQ/master/installtorqapp.sh |
| 11 | + |
| 12 | +torq_latest=`get_latest_release "AquaQAnalytics/TorQ"` |
| 13 | + |
| 14 | +if [[ $torq_latest == *?.?.? ]] || [[ $torq_latest == *?.??.?? ]]; |
| 15 | +then |
| 16 | + echo "=============================================================" |
| 17 | + echo "Latest TorQ release" |
| 18 | + echo $torq_latest |
| 19 | + echo "Getting the latest TorQ .tar.gz file" |
| 20 | + echo "=============================================================" |
| 21 | + |
| 22 | + |
| 23 | +else |
| 24 | + echo "the tag for Torq release: " |
| 25 | + echo $torq_latest |
| 26 | + echo "Is not in the right format, exiting script." |
| 27 | + exit 1 |
| 28 | +fi |
| 29 | + |
| 30 | +wget --content-disposition https://github.com/AquaQAnalytics/TorQ/archive/$torq_latest.tar.gz |
| 31 | + |
| 32 | +echo $torq_latest |
| 33 | + |
| 34 | +if [ "${torq_latest%%v*}" ] |
| 35 | +then |
| 36 | + echo "tag doesn't start with v" |
| 37 | +else |
| 38 | + torq_latest=${torq_latest#?} |
| 39 | +fi |
| 40 | + |
| 41 | +echo $torq_latest |
| 42 | + |
| 43 | +torq_taq_latest=`get_latest_release "AquaQAnalytics/TorQ-TAQ"` |
| 44 | + |
| 45 | +echo "=============================================================" |
| 46 | +echo "Latest TorQ-TAQ release" |
| 47 | +echo $torq_taq_latest |
| 48 | +echo "Getting the latest TorQ-TAQ .tar.gz file" |
| 49 | +echo "=============================================================" |
| 50 | + |
| 51 | +if [[ $torq_taq_latest == *?.?.? ]] || [[ $torq_taq_latest == *?.??.?? ]]; |
| 52 | +then |
| 53 | + echo "=============================================================" |
| 54 | + echo "Latest TorQ-TAQ release" |
| 55 | + echo $torq_taq_latest |
| 56 | + echo "Getting the latest TorQ-TAQ .tar.gz file" |
| 57 | + echo "=============================================================" |
| 58 | + |
| 59 | + |
| 60 | +else |
| 61 | + echo "the tag for Torq release: " |
| 62 | + echo $torq_taq_latest |
| 63 | + echo "Is not in the right format, exiting script." |
| 64 | + exit 1 |
| 65 | +fi |
| 66 | + |
| 67 | + |
| 68 | +wget --content-disposition https://github.com/AquaQAnalytics/TorQ-TAQ/archive/$torq_taq_latest.tar.gz |
| 69 | + |
| 70 | +echo $torq_taq_latest |
| 71 | + |
| 72 | +if [ "${torq_taq_latest%%v*}" ] |
| 73 | +then |
| 74 | + echo "tag doesn't start with v" |
| 75 | +else |
| 76 | + torq_taq_latest=${torq_taq_latest#?} |
| 77 | +fi |
| 78 | + |
| 79 | +echo $torq_taq_latest |
| 80 | + |
| 81 | +echo "Files downloaded. Executing install script" |
| 82 | + |
| 83 | +bash installtorqapp.sh --torq TorQ-$torq_latest.tar.gz --releasedir deploy --data datatemp --installfile TorQ-TAQ-$torq_taq_latest.tar.gz |
| 84 | + |
| 85 | +mkdir -p datatemp/filedrop |
0 commit comments