From b45876cf6e256530c7d4de1f957ff5d5b2c3aa13 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Mon, 7 Nov 2022 21:41:47 +0000 Subject: [PATCH] add update script --- update.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 update.sh diff --git a/update.sh b/update.sh new file mode 100644 index 0000000000..7e207d5e64 --- /dev/null +++ b/update.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +set -e + +echo "Updating OneUptime. This will cause a few minutes of downtime. If you would like to avoid downtime, please consider installing this on a Kubernetes cluster." +read -r -p "Do you want to update OneUptime? [y/N] " response +if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]] +then + echo "OK!" +else + exit +fi + +cd oneuptime +git pull +cd ../ + +rm -f docker-compose.yml +cp oneuptime/docker-compose.yml docker-compose.yml.tmpl +envsubst < docker-compose.yml.tmpl > docker-compose.yml +rm docker-compose.yml.tmpl + +docker-compose pull + +echo "Stopping the stack!" +docker-compose stop + +echo "Checking if async migrations are up to date" +sudo -E docker-compose run init + + + +echo "OK, Restarting the stack!" +sudo -E docker-compose up -d + + +echo "OneUptime upgraded successfully!" \ No newline at end of file