@@ -19,38 +19,6 @@ variables
1919color
2020catch_errors
2121
22- function build_maintainerr() {
23- NODE_VERSION=" 24" setup_nodejs
24- msg_info " Preparing Build Runtime"
25- export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
26- $STD corepack enable
27- if [[ -f /opt/maintainerr/package.json ]]; then
28- if command -v jq > /dev/null 2>&1 ; then
29- yarn_spec=$( jq -r ' .packageManager // empty' /opt/maintainerr/package.json 2> /dev/null || true)
30- if [[ -n " $yarn_spec " && " $yarn_spec " == yarn@* ]]; then
31- yarn_ver=" ${yarn_spec# yarn@ } "
32- yarn_ver=" ${yarn_ver%% +* } "
33- $STD corepack prepare " yarn@${yarn_ver} " --activate || true
34- fi
35- fi
36- fi
37- msg_ok " Prepared Build Runtime"
38-
39- msg_info " Building Maintainerr (Patience)"
40- cd /opt/maintainerr || { msg_error " Failed to change to /opt/maintainerr" ; return 1; }
41- cat << 'EOF ' >/opt/maintainerr/apps/ui/.env
42- VITE_BASE_PATH=/__PATH_PREFIX__
43- EOF
44- export NODE_OPTIONS=" --max-old-space-size=4096"
45- $STD yarn install --immutable --network-timeout 99999999
46- $STD yarn turbo build
47- $STD yarn workspaces focus --all --production
48- mkdir -p /opt/maintainerr/apps/server/dist/ui
49- cp -a /opt/maintainerr/apps/ui/dist/. /opt/maintainerr/apps/server/dist/ui/
50- ln -sfnT /opt/maintainerr /opt/app
51- msg_ok " Built Maintainerr"
52- }
53-
5422function update_script() {
5523 header_info
5624 check_container_storage
@@ -66,11 +34,39 @@ function update_script() {
6634 systemctl stop maintainerr
6735 msg_ok " Stopped Service"
6836
69- CLEAN_INSTALL=1 fetch_and_deploy_gh_release " maintainerr" " Maintainerr/Maintainerr" " tarball" " latest" " /opt/maintainerr"
70- build_maintainerr
37+ CLEAN_INSTALL=1 fetch_and_deploy_gh_release " maintainerr" " Maintainerr/Maintainerr" " tarball"
38+
39+ NODE_VERSION=" 24" setup_nodejs
40+ msg_info " Preparing Build Runtime"
41+ export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
42+ $STD corepack enable
43+ if [[ -f /opt/maintainerr/package.json ]]; then
44+ if command -v jq > /dev/null 2>&1 ; then
45+ yarn_spec=$( jq -r ' .packageManager // empty' /opt/maintainerr/package.json 2> /dev/null || true)
46+ if [[ -n " $yarn_spec " && " $yarn_spec " == yarn@* ]]; then
47+ yarn_ver=" ${yarn_spec# yarn@ } "
48+ yarn_ver=" ${yarn_ver%% +* } "
49+ $STD corepack prepare " yarn@${yarn_ver} " --activate || true
50+ fi
51+ fi
52+ fi
53+ msg_ok " Prepared Build Runtime"
54+
55+ msg_info " Building Maintainerr (Patience)"
56+ cd /opt/maintainerr || { msg_error " Failed to change to /opt/maintainerr" ; exit 1; }
57+ cat << EOF >/opt/maintainerr/apps/ui/.env
58+ VITE_BASE_PATH=/__PATH_PREFIX__
59+ EOF
60+ export NODE_OPTIONS=" --max-old-space-size=4096"
61+ $STD yarn install --immutable --network-timeout 99999999
62+ $STD yarn turbo build
63+ $STD yarn workspaces focus --all --production
64+ mkdir -p /opt/maintainerr/apps/server/dist/ui
65+ cp -a /opt/maintainerr/apps/ui/dist/. /opt/maintainerr/apps/server/dist/ui/
66+ ln -sfnT /opt/maintainerr /opt/app
67+ msg_ok " Built Maintainerr"
7168
7269 msg_info " Starting Service"
73- systemctl daemon-reload
7470 systemctl start maintainerr
7571 msg_ok " Started Service"
7672 msg_ok " Updated successfully!"
0 commit comments