@@ -27,36 +27,32 @@ function update_script() {
2727 msg_error " No ${APP} Installation Found!"
2828 exit
2929 fi
30+
3031 RELEASE=$( curl -fsSL https://api.github.com/repos/outline/outline/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
31- if [[ ! -f /opt/ ${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/ ${APP} _version.txt ) " ]]; then
32+ if [[ ! -f ~ /.outline ]] || [[ " ${RELEASE} " != " $( cat ~ /.outline ) " ]]; then
3233 msg_info " Stopping Services"
3334 systemctl stop outline
3435 msg_ok " Services Stopped"
3536
36- msg_info " Updating ${APP} to ${RELEASE} "
37- temp_file=$( mktemp)
37+ msg_info " Creating backup"
3838 cp /opt/outline/.env /opt
39- rm -rf /opt/outline
40- curl -fsSL " https://github.com/outline/outline/archive/refs/tags/v${RELEASE} .tar.gz" -o " $temp_file "
41- tar zxf " $temp_file "
42- mv outline-" ${RELEASE} " /opt/outline
39+ msg_ok " Backup created"
40+
41+ fetch_and_deploy_gh_release " outline" " outline/outline" " tarball"
42+
43+ msg_info " Updating ${APP} to ${RELEASE} "
4344 cd /opt/outline
4445 export NODE_ENV=development
4546 export NODE_OPTIONS=" --max-old-space-size=3584"
4647 $STD yarn install --frozen-lockfile
4748 $STD yarn build
4849 mv /opt/.env /opt/outline
49- echo " ${RELEASE} " > /opt/${APP} _version.txt
5050 msg_ok " Updated ${APP} "
5151
5252 msg_info " Starting Services"
5353 systemctl start outline
5454 msg_ok " Started Services"
5555
56- msg_info " Cleaning Up"
57- rm -rf " $temp_file "
58- rm -rf " $HOME " /outline-" ${RELEASE} "
59- msg_ok " Cleaned"
6056 msg_ok " Updated Successfully"
6157 else
6258 msg_ok " No update required. ${APP} is already at ${RELEASE} "
0 commit comments