From d753be9383b9f733e58945ffa0940affe4efb60c Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 13 Sep 2022 17:12:45 +0200 Subject: [PATCH] remove more unused scripts --- scripts/maintenance-upgrade.sh | 16 --------------- scripts/portal-down.sh | 37 ---------------------------------- scripts/portal-restart.sh | 18 ----------------- scripts/portal-up.sh | 6 ------ scripts/portal-upgrade.sh | 26 ------------------------ 5 files changed, 103 deletions(-) delete mode 100755 scripts/maintenance-upgrade.sh delete mode 100755 scripts/portal-down.sh delete mode 100755 scripts/portal-restart.sh delete mode 100755 scripts/portal-up.sh delete mode 100755 scripts/portal-upgrade.sh diff --git a/scripts/maintenance-upgrade.sh b/scripts/maintenance-upgrade.sh deleted file mode 100755 index f9ca1b40..00000000 --- a/scripts/maintenance-upgrade.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /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 diff --git a/scripts/portal-down.sh b/scripts/portal-down.sh deleted file mode 100755 index 476ce837..00000000 --- a/scripts/portal-down.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -e # exit on first error - -while getopts d:t:r: flag -do - case "${flag}" in - d) delay=${OPTARG};; - t) timeout=${OPTARG};; - r) reason=${OPTARG};; - esac -done -delay=${delay:-0} # default to no delay -timeout=${timeout:-300} # default timeout is 300s - -if [[ -z $reason ]]; then - echo "Please provide a reason for disabling the portal (use '-r ')." - exit 1 -fi - -countdown() { - local secs=$1 - while [ $secs -gt 0 ]; do - echo -ne "Waiting $secs\033[0K\r" - sleep 1 - : $((secs--)) - done -} - -# delay disabling the portal -countdown $delay - -# stop health-check so the server is taken our of load balancer -docker exec health-check cli disable $reason - -# then wait 5 minutes for the load balancer to propagate the dns records -countdown $timeout diff --git a/scripts/portal-restart.sh b/scripts/portal-restart.sh deleted file mode 100755 index 354bfdbf..00000000 --- a/scripts/portal-restart.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -e # exit on first error - -# get current working directory (pwd doesn't cut it) -cwd=$(cd -P -- "$(dirname -- "$0")" && pwd -P) - -# put the server down for maintenance -. ${cwd}/portal-down.sh - -# stop the docker services -docker-compose down - -# start the docker services -docker-compose up -d - -# enable the server again -. ${cwd}/portal-up.sh diff --git a/scripts/portal-up.sh b/scripts/portal-up.sh deleted file mode 100755 index fcd7fe80..00000000 --- a/scripts/portal-up.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -e # exit on first error - -# start the health-checks service -docker exec health-check cli enable diff --git a/scripts/portal-upgrade.sh b/scripts/portal-upgrade.sh deleted file mode 100755 index 36ea7de3..00000000 --- a/scripts/portal-upgrade.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -set -e # exit on first error - -# get current working directory (pwd doesn't cut it) -cwd=$(cd -P -- "$(dirname -- "$0")" && pwd -P) - -# put the server down for maintenance -. ${cwd}/portal-down.sh - -# build all container without cache -docker-compose build --no-cache --parallel --pull --quiet - -# stop the docker services -docker-compose down -v - -# clear unused docker containers so we don't run into out of disk space -# it should be done after the container have been stopped and before -# building them again -docker system prune --force - -# start the docker services -docker-compose up -d - -# enable the server again -. ${cwd}/portal-up.sh