This commit is contained in:
Derek Smith 2023-02-01 16:11:50 -05:00
parent 144b0209eb
commit 48a26c0db0
Signed by: farscapian
GPG Key ID: 8F1CD799CCA516CC
3 changed files with 24 additions and 21 deletions

View File

@ -2,27 +2,6 @@
set -ex set -ex
if lxc remote get-default | grep -q "production"; then
echo "WARNING: You are running a migration procedure on a production system."
echo ""
# 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
RESPONSE=
read -r -p " Are you sure you want to continue (y) ": RESPONSE
if [ "$RESPONSE" != "y" ]; then
echo "STOPPING."
exit 1
fi
fi
export DEPLOY_WWW_SERVER=false export DEPLOY_WWW_SERVER=false
export DEPLOY_GHOST=false export DEPLOY_GHOST=false

23
deployment/check_environment.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
set -ex
if lxc remote get-default | grep -q "production"; then
echo "WARNING: You are running a migration procedure on a production system."
echo ""
# 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
RESPONSE=
read -r -p " Are you sure you want to continue (y) ": RESPONSE
if [ "$RESPONSE" != "y" ]; then
echo "STOPPING."
exit 1
fi
fi

View File

@ -7,6 +7,7 @@ LATEST_GIT_COMMIT="$(cat ../.git/refs/heads/master)"
export LATEST_GIT_COMMIT="$LATEST_GIT_COMMIT" export LATEST_GIT_COMMIT="$LATEST_GIT_COMMIT"
./check_dependencies.sh ./check_dependencies.sh
./check_environment.sh
DOMAIN_NAME= DOMAIN_NAME=
RUN_CERT_RENEWAL=true RUN_CERT_RENEWAL=true