From d5ca904a5500c9f44eb2f0a18304d9937439bd04 Mon Sep 17 00:00:00 2001 From: Laura Herzog Date: Thu, 2 Jun 2022 12:56:01 +0200 Subject: [PATCH] Made update more talkative --- src/lib/include/system.sh | 13 ++++++------- src/updates/update-20220602.sh | 22 ++++++++++++++++++++++ update.sh | 9 +++------ 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/lib/include/system.sh b/src/lib/include/system.sh index ca8fa3ac..75ae515f 100644 --- a/src/lib/include/system.sh +++ b/src/lib/include/system.sh @@ -248,9 +248,9 @@ function doil_system_remove_services() { function doil_system_install_proxyserver() { cd /usr/local/lib/doil/server/proxy - FOO=$(docker-compose build 2>&1 > /dev/null) 2>&1 > /dev/null - doil system:salt start # --quiet - FOO=$(docker-compose up -d 2>&1 > /dev/null) 2>&1 > /dev/null + FOO=$(docker-compose build) + doil system:salt start --quiet + FOO=$(docker-compose up -d) sleep 10 docker exec -i doil_saltmain bash -c "salt 'doil.proxy' state.highstate saltenv=proxyservices" >> /var/log/doil.log docker commit doil_proxy doil_proxy:stable > /dev/null @@ -259,10 +259,9 @@ function doil_system_install_proxyserver() { function doil_system_install_mailserver() { cd /usr/local/lib/doil/server/mail - FOO=$(docker-compose build 2>&1 > /dev/null) 2>&1 > /dev/null - doil system:salt start #--quiet - doil system:mail start #--quiet - FOO=$(docker-compose up -d 2>&1 > /dev/null) 2>&1 > /dev/null + FOO=$(docker-compose build) + doil system:salt start --quiet + doil system:mail start --quiet sleep 10 docker exec -i doil_saltmain bash -c "salt 'doil.postfix' state.highstate saltenv=mailservices" >> /var/log/doil.log docker commit doil_postfix doil_postfix:stable > /dev/null diff --git a/src/updates/update-20220602.sh b/src/updates/update-20220602.sh index 832f30a0..9e648984 100755 --- a/src/updates/update-20220602.sh +++ b/src/updates/update-20220602.sh @@ -2,18 +2,40 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source ${SCRIPT_DIR}/../lib/include/system.sh +source ${SCRIPT_DIR}/../lib/include/log.sh +source ${SCRIPT_DIR}/colors.sh doil_update_20220602() { + doil_status_send_message "Stopping all services" doil_system_stop_all_services + doil_status_okay + + doil_status_send_message "Removing old doil services" doil_system_remove_services + doil_status_okay + + doil_status_send_message "Removing old doil system" doil_system_remove_old_version + doil_status_okay + + doil_status_send_message "Copying doil new system" doil_system_create_folder doil_system_copy_doil + doil_status_okay + + doil_status_send_message "Reinstalling salt service" doil_system_replace_salt_stack doil system:salt start --quiet + doil_status_okay + + doil_status_send_message "Reinstalling proxy service" doil_system_install_proxyserver + doil_status_okay + + doil_status_send_message "Installing mail service" doil_system_install_mailserver + doil_status_okay return 0 } \ No newline at end of file diff --git a/update.sh b/update.sh index 6677d3f6..86a6ff1f 100755 --- a/update.sh +++ b/update.sh @@ -54,13 +54,10 @@ fi # status for check requirements doil_status_okay +echo "Performing updates. This will take a while." +echo " " + # perform the update doil_perform_update -echo -n "Restarting server ..." - -doil system:proxy restart --quiet -doil system:salt restart --quiet -doil system:mail restart --quiet - printf " ${GREEN}ok${NC}\n"