Skip to content

Commit

Permalink
Made update more talkative
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura Herzog committed Jun 2, 2022
1 parent a25b1c0 commit d5ca904
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
13 changes: 6 additions & 7 deletions src/lib/include/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
22 changes: 22 additions & 0 deletions src/updates/update-20220602.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
9 changes: 3 additions & 6 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit d5ca904

Please sign in to comment.