Whitespace, formatting, control udpates.
This commit is contained in:
parent
1ecbfe4442
commit
e38172dd2d
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@ -13,8 +13,8 @@
|
||||
"shellcheck.customArgs": [],
|
||||
"shellcheck.ignorePatterns": {},
|
||||
"shellcheck.exclude": [
|
||||
"SC1090",
|
||||
"SC1091",
|
||||
// "SC1090",
|
||||
// "SC1091",
|
||||
"SC2029"
|
||||
],
|
||||
"terminal.integrated.fontFamily": "monospace",
|
||||
|
10
cluster.sh
10
cluster.sh
@ -3,9 +3,9 @@
|
||||
set -eux
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# NOTE This script is meant to be executed on your LXD bare metal servers. This script
|
||||
# ensures that the LXD daemon is installed via snap package, then initialize the daemon
|
||||
# to operate in clustered mode
|
||||
# This script is meant to be executed on the management machine.
|
||||
# it reaches out to an SSH endpoint and provisions that machine
|
||||
# to use LXD.
|
||||
|
||||
COMMAND="${1:-}"
|
||||
DATA_PLANE_MACVLAN_INTERFACE=
|
||||
@ -16,6 +16,7 @@ if [ "$COMMAND" = create ]; then
|
||||
# override the cluster name.
|
||||
CLUSTER_NAME="${2:-}"
|
||||
|
||||
|
||||
if [ -z "$CLUSTER_NAME" ]; then
|
||||
echo "ERROR: The cluster name was not provided."
|
||||
exit 1
|
||||
@ -61,6 +62,7 @@ EOL
|
||||
|
||||
if ! lxc remote list | grep -q "$CLUSTER_NAME"; then
|
||||
FQDN="${3:-}"
|
||||
shift
|
||||
|
||||
if [ -z "$FQDN" ]; then
|
||||
echo "ERROR: The Fully Qualified Domain Name of the new cluster member was not set."
|
||||
@ -85,7 +87,7 @@ EOL
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
@ -14,9 +14,12 @@ if [ "$UPDATE_BTCPAY" = true ]; then
|
||||
# btcpay-update.sh brings services back up, but does not take them down.
|
||||
ssh "$FQDN" "sudo bash -c $BTCPAY_SERVER_APPPATH/btcpay-update.sh"
|
||||
|
||||
sleep 20
|
||||
|
||||
elif [ "$RESTORE_BTCPAY" = true ]; then
|
||||
# run the update.
|
||||
ssh "$FQDN" "bash -c $BTCPAY_SERVER_APPPATH/btcpay-down.sh"
|
||||
sleep 10
|
||||
|
||||
./restore.sh
|
||||
|
||||
@ -54,7 +57,14 @@ if [ "$RUN_SERVICES" = true ]; then
|
||||
fi
|
||||
|
||||
if [ "$OPEN_URL" = true ]; then
|
||||
if wait-for-it -t 5 "$FQDN:443"; then
|
||||
xdg-open "https://$FQDN" > /dev/null 2>&1
|
||||
|
||||
if [ "$VPS_HOSTING_TARGET" = lxd ]; then
|
||||
if wait-for-it -t 5 "$WWW_FQDN:443"; then
|
||||
xdg-open "https://$WWW_FQDN" > /dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
if wait-for-it -t 5 "$FQDN:443"; then
|
||||
xdg-open "https://$FQDN" > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -49,9 +49,7 @@ if ! lxc image list --format csv "$VM_NAME" | grep -q "$VM_NAME"; then
|
||||
lxc config set "$VM_NAME" "volatile.enp5s0.hwaddr=$SOVEREIGN_STACK_MAC_ADDRESS"
|
||||
|
||||
lxc start "$VM_NAME"
|
||||
|
||||
# let's wait a minimum of 15 seconds before we start checking for an IP address.
|
||||
sleep 15
|
||||
sleep 10
|
||||
|
||||
# let's wait for the LXC vm remote machine to get an IP address.
|
||||
./wait_for_lxc_ip.sh "$VM_NAME"
|
||||
@ -59,5 +57,5 @@ if ! lxc image list --format csv "$VM_NAME" | grep -q "$VM_NAME"; then
|
||||
# stop the VM and get a snapshot.
|
||||
lxc stop "$VM_NAME"
|
||||
lxc publish "$CLUSTER_NAME:$VM_NAME" --alias "$VM_NAME" --public
|
||||
lxc delete "$VM_NAME"
|
||||
|
||||
fi
|
||||
|
@ -3,7 +3,6 @@
|
||||
set -eux
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
|
||||
# let's make sure we have an ssh keypair. We just use ~/.ssh/id_rsa
|
||||
# TODO convert this to SSH private key held on Trezor. THus trezor-T required for
|
||||
# login operations. This should be configurable of course.
|
||||
@ -83,4 +82,4 @@ export DOCKER_HOST="ssh://ubuntu@$FQDN"
|
||||
# the following scripts take responsibility for the rest of the provisioning depending on the app you're deploying.
|
||||
bash -c "./$VIRTUAL_MACHINE/go.sh"
|
||||
|
||||
echo "Successfull deployed '$DOMAIN_NAME' with git commit '$(cat ./.git/refs/heads/master)' VPS_HOSTING_TARGET=$VPS_HOSTING_TARGET;"
|
||||
echo "Successfully deployed '$DOMAIN_NAME' with git commit '$(cat ./.git/refs/heads/master)' VPS_HOSTING_TARGET=$VPS_HOSTING_TARGET;"
|
||||
|
@ -22,5 +22,7 @@ done
|
||||
# we are using IP address here so we don't have to rely on external DNS
|
||||
# configuration for the base image preparataion.
|
||||
ssh-keygen -R "$IP_V4_ADDRESS"
|
||||
|
||||
ssh-keyscan -H -t ecdsa "$IP_V4_ADDRESS" >> "$SSH_HOME/known_hosts"
|
||||
|
||||
ssh "ubuntu@$IP_V4_ADDRESS" sudo chown -R ubuntu:ubuntu /home/ubuntu
|
||||
|
Loading…
Reference in New Issue
Block a user