handle deno, site and pds-dash updates

This commit is contained in:
Ruben 2025-10-13 10:43:17 -05:00
commit 4c6be95728
Signed by: sneexy
GPG key ID: 8ECFA045E63BC583

View file

@ -47,7 +47,7 @@ function check_applications {
# attempt to detect the system based on hostname # attempt to detect the system based on hostname
function detect_system { function detect_system {
local valid_systems=("phosphorus" "neptunium" "cerium" "synthnix") local valid_systems=("phosphorus" "neptunium")
local current_hostname=$(hostname) local current_hostname=$(hostname)
for system in "${valid_systems[@]}"; do for system in "${valid_systems[@]}"; do
@ -192,6 +192,16 @@ function update_docker_container {
fi fi
} }
# deno install - installs/updates deno if required on the system, only used for neptunium currently
function deno_install {
if [ "$synth_current_system" = "neptunium" ]; then # only used on neptunium
echo "${blue}Running Deno installer.${normal}"
wget https://deno.land/install.sh -O /tmp/deno.sh && chmod +x /tmp/deno.sh
DENO_INSTALL=/usr/local /tmp/deno.sh -y # we assume deno has some error checking and with our script config will automatically stop for any issues
echo "${green}Okay.${normal}"
fi
}
# ╭──────────────╮ # ╭──────────────╮
# │ upgrade step │ # │ upgrade step │
# ╰──────────────╯ # ╰──────────────╯
@ -203,6 +213,7 @@ function system_upgrade {
if [ "$synth_current_system" = "phosphorus" ]; then # phosphorus if [ "$synth_current_system" = "phosphorus" ]; then # phosphorus
# apt/system related upgrade # apt/system related upgrade
base_system_upgrade base_system_upgrade
deno_update
# docker # docker
update_docker_container "/srv/docker" "aode" "compose.yaml" update_docker_container "/srv/docker" "aode" "compose.yaml"
update_docker_container "/srv/docker" "sharkey" "compose.yaml" update_docker_container "/srv/docker" "sharkey" "compose.yaml"
@ -214,6 +225,7 @@ function system_upgrade {
elif [ "$synth_current_system" = "neptunium" ]; then # neptunium elif [ "$synth_current_system" = "neptunium" ]; then # neptunium
# apt/system related upgrade # apt/system related upgrade
base_system_upgrade base_system_upgrade
deno_install
# docker # docker
update_docker_container "/srv/docker" "ask-js" "compose.yaml" update_docker_container "/srv/docker" "ask-js" "compose.yaml"
update_docker_container "/srv/docker" "caddy" "compose.yaml" update_docker_container "/srv/docker" "caddy" "compose.yaml"
@ -226,6 +238,13 @@ function system_upgrade {
update_docker_container "/srv/docker" "vaultwarden" "compose.yaml" update_docker_container "/srv/docker" "vaultwarden" "compose.yaml"
update_docker_container "/srv/docker" "zitadel" "compose.yaml" update_docker_container "/srv/docker" "zitadel" "compose.yaml"
update_docker_container "/srv/docker/forgejo" "runner" "compose.yaml" update_docker_container "/srv/docker/forgejo" "runner" "compose.yaml"
# sites/others
echo "${blue}Pulling main site...${normal}"
git pull /var/www/site # main site
# pds-dash
echo "${blue}Updating pds-dash...${normal}"
git pull /var/www/pds-dash
cd /var/www/pds-dash && deno install && deno task build
# done # done
echo "${green}System upgrade finished! beep!~${normal}" echo "${green}System upgrade finished! beep!~${normal}"
fi fi