Update debugging info.

This commit is contained in:
Derek Smith 2023-03-06 15:42:17 -05:00
parent 2f16d2de0a
commit eb67ec10a7
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
10 changed files with 55 additions and 20 deletions

View File

@ -98,3 +98,5 @@ export REMOTE_CERT_BASE_DIR="$REMOTE_HOME/.certs"
export ROOT_DISK_SIZE_GB=20 export ROOT_DISK_SIZE_GB=20
export REGISTRY_URL="https://index.docker.io/v1/" export REGISTRY_URL="https://index.docker.io/v1/"
export PRIMARY_DOMAIN= export PRIMARY_DOMAIN=
export TARGET_PROJECT_GIT_COMMIT=0701de580bdd6d32058852b0c6f290867d2d8ea2

View File

@ -0,0 +1,5 @@
#!/bin/bash
# purpose of script is to switch the ./project repo to the git commit as

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -ex set -e
cd "$(dirname "$0")" cd "$(dirname "$0")"
# This script is meant to be executed on the management machine. # This script is meant to be executed on the management machine.

View File

@ -30,8 +30,6 @@ export CLUSTER_PATH="$CLUSTERS_DIR/$CURRENT_CLUSTER"
CLUSTER_DEFINITION="$CLUSTER_PATH/cluster_definition" CLUSTER_DEFINITION="$CLUSTER_PATH/cluster_definition"
export CLUSTER_DEFINITION="$CLUSTER_DEFINITION" export CLUSTER_DEFINITION="$CLUSTER_DEFINITION"
echo "CLUSTER_DEFINITION: $CLUSTER_DEFINITION"
# ensure the cluster definition exists. # ensure the cluster definition exists.
if [ ! -f "$CLUSTER_DEFINITION" ]; then if [ ! -f "$CLUSTER_DEFINITION" ]; then
echo "ERROR: The cluster definition could not be found. You may need to run 'ss-cluster'." echo "ERROR: The cluster definition could not be found. You may need to run 'ss-cluster'."

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -ex set -e
cd "$(dirname "$0")" cd "$(dirname "$0")"
# this script takes down all resources in the cluster. This script is DESTRUCTIVE of data, so make sure it's backed up first. # this script takes down all resources in the cluster. This script is DESTRUCTIVE of data, so make sure it's backed up first.

View File

@ -3,6 +3,15 @@
set -exu set -exu
cd "$(dirname "$0")" cd "$(dirname "$0")"
# check if there are any uncommited changes. It's dangerous to
# alter production systems when you have commits to make or changes to stash.
if git update-index --refresh | grep -q "needs update"; then
echo "ERROR: You have uncommited changes! You MUST commit or stash all changes to continue."
exit 1
fi
USER_SAYS_YES=false USER_SAYS_YES=false
for i in "$@"; do for i in "$@"; do
@ -23,6 +32,19 @@ done
. ./project_env.sh . ./project_env.sh
# deploy clams wallet.
PROJECTS_SCRIPTS_REPO_URL="https://git.sovereign-stack.org/ss/project"
PROJECTS_SCRIPTS_PATH="$(pwd)/deployment/project"
if [ ! -d "$PROJECTS_SCRIPTS_PATH" ]; then
git clone "$PROJECTS_SCRIPTS_REPO_URL" "$PROJECTS_SCRIPTS_PATH"
else
cd "$PROJECTS_SCRIPTS_PATH"
git pull
cd -
fi
# Check to see if any of the VMs actually don't exist. # Check to see if any of the VMs actually don't exist.
# (we only migrate instantiated vms) # (we only migrate instantiated vms)
for VM in www btcpayserver; do for VM in www btcpayserver; do
@ -43,11 +65,31 @@ echo "INFO: The BTCPAY_RESTORE_ARCHIVE_PATH for this migration will be: $BTCPAY_
# the --stop flag ensures that services do NOT come back online. # the --stop flag ensures that services do NOT come back online.
# by default, we grab a backup. # by default, we grab a backup.
# first, let's grab the GIT commit from the remote machine.
export DOMAIN_NAME="$PRIMARY_DOMAIN"
export SITE_PATH="$SITES_PATH/$PRIMARY_DOMAIN"
# source the site path so we know what features it has.
source ../defaults.sh
source "$SITE_PATH/site_definition"
source ./project/domain_env.sh
GIT_COMMIT_ON_REMOTE_HOST="$(ssh ubuntu@$BTCPAY_FQDN cat /home/ubuntu/.ss-githead)"
cd project/
git checkout "$GIT_COMMIT_ON_REMOTE_HOST"
cd -
sleep 5
# run deploy which backups up everything, but doesnt restart any services. # run deploy which backups up everything, but doesnt restart any services.
bash -c "./project/deploy.sh --stop --no-cert-renew --backup-archive-path=$BTCPAY_RESTORE_ARCHIVE_PATH" bash -c "./project/deploy.sh --stop --no-cert-renew --backup-archive-path=$BTCPAY_RESTORE_ARCHIVE_PATH"
# call the destroy script. If user proceed, then user data is DESTROYED! # call the destroy script. If user proceed, then user data is DESTROYED!
USER_SAYS_YES="$USER_SAYS_YES" ./destroy.sh USER_SAYS_YES="$USER_SAYS_YES" ./destroy.sh
cd project/
git checkout "$TARGET_PROJECT_GIT_COMMIT"
cd -
sleep 5
# Then we can run a restore operation and specify the backup archive at the CLI. # Then we can run a restore operation and specify the backup archive at the CLI.
bash -c "./project/deploy.sh -y --restore-www --restore-btcpay --backup-archive-path=$BTCPAY_RESTORE_ARCHIVE_PATH" bash -c "./project/deploy.sh -y --restore-www --restore-btcpay --backup-archive-path=$BTCPAY_RESTORE_ARCHIVE_PATH"

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -ex set -e
cd "$(dirname "$0")" cd "$(dirname "$0")"
source ../defaults.sh source ../defaults.sh

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -exu set -eu
cd "$(dirname "$0")" cd "$(dirname "$0")"
# see https://www.sovereign-stack.org/management/ # see https://www.sovereign-stack.org/management/
@ -138,15 +138,3 @@ if [ "$ADDED_COMMAND" = true ]; then
echo "NOTICE! You need to run 'source ~/.bashrc' before continuing. After that, type 'ss-manage' to enter your management environment." echo "NOTICE! You need to run 'source ~/.bashrc' before continuing. After that, type 'ss-manage' to enter your management environment."
fi fi
# deploy clams wallet.
PROJECTS_SCRIPTS_REPO_URL="https://git.sovereign-stack.org/ss/project"
PROJECTS_SCRIPTS_PATH="$(pwd)/deployment/project"
if [ ! -d "$PROJECTS_SCRIPTS_PATH" ]; then
git clone "$PROJECTS_SCRIPTS_REPO_URL" "$PROJECTS_SCRIPTS_PATH"
else
cd "$PROJECTS_SCRIPTS_PATH"
git config --global pull.rebase false
git pull
cd -
fi

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -exu set -eu
cd "$(dirname "$0")" cd "$(dirname "$0")"
# this script will tag the repo then push it to origin # this script will tag the repo then push it to origin

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -exu set -eu
# this script undoes install.sh # this script undoes install.sh
if ! command -v lxc >/dev/null 2>&1; then if ! command -v lxc >/dev/null 2>&1; then