Update guardian-install.sh
This commit is contained in:
parent
07cc74b074
commit
e7a9bc04c6
@ -14,31 +14,28 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt install -y \
|
$STD apt install -y sqlite3
|
||||||
sqlite3
|
|
||||||
NODE_VERSION="24" setup_nodejs
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Setup Guardian"
|
NODE_VERSION="24" setup_nodejs
|
||||||
fetch_and_deploy_gh_release "guardian" "HydroshieldMKII/Guardian" "tarball" "latest" "/opt/guardian"
|
fetch_and_deploy_gh_release "guardian" "HydroshieldMKII/Guardian" "tarball" "latest" "/opt/guardian"
|
||||||
|
|
||||||
|
msg_info "Configuring ${APPLICATION}"
|
||||||
msg_info "Building App"
|
|
||||||
cd /opt/guardian/backend
|
cd /opt/guardian/backend
|
||||||
$STD npm ci
|
$STD npm ci
|
||||||
$STD npm run build
|
$STD npm run build
|
||||||
|
|
||||||
cd /opt/guardian/frontend
|
cd /opt/guardian/frontend
|
||||||
$STD npm ci
|
$STD npm ci
|
||||||
export DEPLOYMENT_MODE=standalone
|
export DEPLOYMENT_MODE=standalone
|
||||||
$STD npm run build
|
$STD npm run build
|
||||||
msg_ok "Built App"
|
msg_ok "Configured {APPLICATION}"
|
||||||
|
|
||||||
msg_info "Creating Services"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/guardian-backend.service
|
cat <<EOF >/etc/systemd/system/guardian-backend.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Guardian Backend
|
Description=Guardian Backend
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt/guardian/backend
|
WorkingDirectory=/opt/guardian/backend
|
||||||
ExecStart=/usr/bin/node dist/main.js
|
ExecStart=/usr/bin/node dist/main.js
|
||||||
@ -53,6 +50,7 @@ cat <<EOF >/etc/systemd/system/guardian-frontend.service
|
|||||||
Description=Guardian Frontend
|
Description=Guardian Frontend
|
||||||
After=guardian-backend.service network.target
|
After=guardian-backend.service network.target
|
||||||
Wants=guardian-backend.service
|
Wants=guardian-backend.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt/guardian/frontend
|
WorkingDirectory=/opt/guardian/frontend
|
||||||
Environment=DEPLOYMENT_MODE=standalone
|
Environment=DEPLOYMENT_MODE=standalone
|
||||||
@ -65,9 +63,10 @@ EOF
|
|||||||
|
|
||||||
systemctl enable -q --now guardian-backend
|
systemctl enable -q --now guardian-backend
|
||||||
systemctl enable -q --now guardian-frontend
|
systemctl enable -q --now guardian-frontend
|
||||||
msg_ok "Created Services"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
customize
|
||||||
|
|
||||||
apt -y autoremove
|
apt -y autoremove
|
||||||
apt -y autoclean
|
apt -y autoclean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user