reafctored the whole script

This commit is contained in:
bilulib
2025-06-14 01:53:52 +02:00
parent ef37953b3f
commit e0e329925f
3 changed files with 331 additions and 56 deletions
+27 -9
View File
@@ -23,19 +23,37 @@ function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/huly-selfhost ]]; then
if [[ ! -d /opt/huly ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating $APP"
cd /opt/huly-selfhost || exit
$STD git pull
if [[ -f .env ]]; then
$STD ./config.sh
$STD ./nginx.sh
fi
msg_info "Restarting $APP services"
systemctl restart huly || true
# Update Huly services by pulling new Docker images and extracting them
$STD systemctl stop minio huly-front huly-account huly-transactor huly-collaborator huly-rekoni
# Temporarily install Docker for updates
$STD apt-get update
$STD apt-get install -y docker.io
$STD systemctl start docker
# Update each component
for component in front account transactor collaborator rekoni; do
msg_info "Updating huly-$component"
$STD docker pull hardcoreeng/$component:latest
$STD docker create --name huly-$component-update hardcoreeng/$component:latest
$STD rm -rf /opt/huly/$component/*
$STD docker cp huly-$component-update:/usr/src/app/. /opt/huly/$component/
$STD docker rm huly-$component-update
done
# Remove Docker again
$STD systemctl stop docker
$STD apt-get remove -y docker.io
# Restart services
$STD systemctl start minio huly-front huly-account huly-transactor huly-collaborator huly-rekoni
msg_ok "Updated $APP"
exit
}