@@ -20,45 +20,48 @@ color
20
20
catch_errors
21
21
22
22
function update_script() {
23
- header_info
24
- check_container_storage
25
- check_container_resources
26
- if [[ ! -d /opt/outline ]]; then
27
- msg_error " No ${APP} Installation Found!"
28
- exit
29
- fi
30
- 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
- msg_info " Stopping Services"
33
- systemctl stop outline
34
- msg_ok " Services Stopped"
23
+ header_info
24
+ check_container_storage
25
+ check_container_resources
26
+ if [[ ! -d /opt/outline ]]; then
27
+ msg_error " No ${APP} Installation Found!"
28
+ exit
29
+ fi
30
+ 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
+ msg_info " Stopping Services"
33
+ systemctl stop outline
34
+ msg_ok " Services Stopped"
35
35
36
- msg_info " Updating ${APP} to ${RELEASE} "
37
- temp_file=$( mktemp)
38
- rm -rf /opt/outline/node_modules
39
- curl -fsSL " https://github.com/outline/outline/archive/refs/tags/v${RELEASE} .tar.gz" -o " $temp_file "
40
- tar zxf $temp_file
41
- cp -rf outline-${RELEASE} /* /opt/outline
42
- cd /opt/outline
43
- export NODE_OPTIONS=" --max-old-space-size=3584"
44
- $STD yarn install --frozen-lockfile
45
- $STD yarn build
46
- echo " ${RELEASE} " > /opt/${APP} _version.txt
47
- msg_ok " Updated ${APP} "
36
+ msg_info " Updating ${APP} to ${RELEASE} "
37
+ temp_file=$( mktemp)
38
+ 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
43
+ cd /opt/outline || exit
44
+ export NODE_ENV=development
45
+ export NODE_OPTIONS=" --max-old-space-size=3584"
46
+ $STD yarn install --frozen-lockfile
47
+ $STD yarn build
48
+ mv /opt/.env /opt/outline
49
+ echo " ${RELEASE} " > /opt/${APP} _version.txt
50
+ msg_ok " Updated ${APP} "
48
51
49
- msg_info " Starting Services"
50
- systemctl start outline
51
- msg_ok " Started Services"
52
+ msg_info " Starting Services"
53
+ systemctl start outline
54
+ msg_ok " Started Services"
52
55
53
- msg_info " Cleaning Up"
54
- rm -rf $temp_file
55
- rm -rf $HOME /outline-${RELEASE}
56
- msg_ok " Cleaned"
57
- msg_ok " Updated Successfully"
58
- else
59
- msg_ok " No update required. ${APP} is already at ${RELEASE} "
60
- fi
61
- exit
56
+ msg_info " Cleaning Up"
57
+ rm -rf " $temp_file "
58
+ rm -rf " $HOME " /outline-" ${RELEASE} "
59
+ msg_ok " Cleaned"
60
+ msg_ok " Updated Successfully"
61
+ else
62
+ msg_ok " No update required. ${APP} is already at ${RELEASE} "
63
+ fi
64
+ exit
62
65
}
63
66
64
67
start
@@ -68,4 +71,4 @@ description
68
71
msg_ok " Completed Successfully!\n"
69
72
echo -e " ${CREATING}${GN}${APP} setup has been successfully initialized!${CL} "
70
73
echo -e " ${INFO}${YW} Access it using the following URL:${CL} "
71
- echo -e " ${TAB}${GATEWAY}${BGN} http://${IP} :3000${CL} "
74
+ echo -e " ${TAB}${GATEWAY}${BGN} http://${IP} :3000${CL} "
0 commit comments