store maintenance upgrade script

This commit is contained in:
Karol Wypchlo 2021-01-23 19:17:49 +01:00
parent 127483f823
commit b3ef6eaf62
1 changed files with 16 additions and 0 deletions

View File

@ -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