← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands-website/update_ops_script into lp:widelands-website

 

SirVer has proposed merging lp:~widelands-dev/widelands-website/update_ops_script into lp:widelands-website.

Commit message:
Adapt the update script for the new server.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands-website/update_ops_script/+merge/369163
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands-website/update_ops_script into lp:widelands-website.
=== modified file '_ops/apt_update.sh'
--- _ops/apt_update.sh	2016-08-26 10:55:57 +0000
+++ _ops/apt_update.sh	2019-06-21 11:41:04 +0000
@@ -1,28 +1,25 @@
 #!/bin/sh
 # Updates all packages on the server, but stops the widelands website before
 # doing so, in case mysql gets updated - it always results in really ugly
-# errors for users otherwise. Ideally, this script would switch the website to
-# a "In Maintenance" banner.
+# errors for users otherwise.
 #
-# This script requires root access.
+# This script requires sudo.
 
 set -ex
 
-if [ -z "$STY" ] && [ -z "$TMUX" ]; then 
+if [ -z "${TMUX}" ]; then 
    echo "Run inside screen or tmux in case SSH gets updated."
    exit 1
 fi
 
-apt-get update
-stop wlwebsite || true
-
-# TODO(sirver): Upgrading widelands-data takes a long time (~30 minutes or
-# longer). Use apt-mark hold to not update widelands and widelands-data to
-# bring the website up quicker again. Then only upgrade those packages later,
-# after the website is up again.
-# See http://askubuntu.com/questions/99774/exclude-packages-from-apt-get-upgrade
-apt-get dist-upgrade
-
-start wlwebsite
-
-apt-get autoremove -y
+sudo apt update
+
+sudo systemctl stop wl-website
+sudo systemctl start wl-bauarbeiten
+
+sudo apt dist-upgrade
+
+sudo systemctl stop wl-bauarbeiten
+sudo systemctl start wl-website
+
+sudo apt autoremove -y


Follow ups