1
1

Wire up project repo.

This commit is contained in:
Derek Smith 2023-03-06 14:44:36 -05:00
parent 0510a36522
commit 2f16d2de0a
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
3 changed files with 23 additions and 6 deletions

2
deployment/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# this is tracked in a distinct git repo.
project

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -eu set -exu
cd "$(dirname "$0")" cd "$(dirname "$0")"
# see https://www.sovereign-stack.org/management/ # see https://www.sovereign-stack.org/management/
@ -137,3 +137,16 @@ lxc restart ss-mgmt
if [ "$ADDED_COMMAND" = true ]; then 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

@ -41,20 +41,22 @@ if ! snap list | grep -q lxd; then
sudo lxd init --auto sudo lxd init --auto
fi fi
echo "Your management machine has been provisioned!"
# run a lxd command so we don't we a warning upon first invocation # run a lxd command so we don't we a warning upon first invocation
lxc list > /dev/null 2>&1 lxc list > /dev/null 2>&1
# add groups for docker and lxd # add groups for docker and lxd
sudo addgroup docker if ! groups ubuntu | grep -q docker; then
sudo addgroup docker
sudo usermod -aG docker ubuntu
sudo usermod -aG lxd ubuntu
fi
sudo usermod -aG docker ubuntu
sudo usermod -aG lxd ubuntu
# if an SSH pubkey does not exist, we create one. # if an SSH pubkey does not exist, we create one.
if [ ! -f /home/ubuntu/.ssh/id_rsa.pub ]; then if [ ! -f /home/ubuntu/.ssh/id_rsa.pub ]; then
# generate a new SSH key for the base vm image. # generate a new SSH key for the base vm image.
ssh-keygen -f /home/ubuntu/.ssh/id_rsa -t ecdsa -b 521 -N "" ssh-keygen -f /home/ubuntu/.ssh/id_rsa -t ecdsa -b 521 -N ""
fi fi
echo "Your management machine has been provisioned!"