remove more unused scripts
This commit is contained in:
parent
08c21cafe4
commit
d753be9383
|
@ -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
|
|
|
@ -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 <reason>')."
|
|
||||||
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
|
|
|
@ -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
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e # exit on first error
|
|
||||||
|
|
||||||
# start the health-checks service
|
|
||||||
docker exec health-check cli enable
|
|
|
@ -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
|
|
Reference in New Issue