From b3ef6eaf62f79bf472eb6e0a59a440a804117ab8 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Sat, 23 Jan 2021 19:17:49 +0100 Subject: [PATCH] store maintenance upgrade script --- scripts/maintenance-upgrade.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 scripts/maintenance-upgrade.sh diff --git a/scripts/maintenance-upgrade.sh b/scripts/maintenance-upgrade.sh new file mode 100644 index 00000000..f9ca1b40 --- /dev/null +++ b/scripts/maintenance-upgrade.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +############################################################### +# this script is an automation for restarting docker containers +# on maintenance nodes strictly built for purpose of siasky.net +############################################################### + +set -e # exit on first error + +docker build --no-cache --quiet --build-arg branch=master -t sia-master /home/user/sia-dockerfile + +for container in `docker container ls --format '{{.Names}}'`; do + docker stop $container + docker rm $container + docker run -d -v /home/user/nodes/$container/sia-data:/sia-data --env-file /home/user/nodes/$container/.env --name $container --log-opt max-size=100m --log-opt max-file=3 sia-master +done