aboutsummaryrefslogtreecommitdiff
path: root/scripts/ci/setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ci/setup.sh')
-rwxr-xr-xscripts/ci/setup.sh24
1 files changed, 8 insertions, 16 deletions
diff --git a/scripts/ci/setup.sh b/scripts/ci/setup.sh
index d9ac70c..84958d0 100755
--- a/scripts/ci/setup.sh
+++ b/scripts/ci/setup.sh
@@ -6,7 +6,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
cd ../../
echo "Unlocking git-crypt repos and configuring git..."
-git config --global user.email "ci@euandre.org"
+git config --global user.email "${GIT_CI_USER}"
git config --global user.name "sr.ht CI"
git crypt unlock
@@ -17,25 +17,17 @@ git remote set-url origin git@git.sr.ht:~euandreh/vps-state
popd
echo "Done."
+gpg --import "${GPG_TO}.gpg"
+
# git smudge after git-crypt clears file permissions
chmod 400 ./secrets/ssh/vps-box-client
cat .envrc >> ~/.buildenv
source .envrc
-SSH_SERVER_PRIVATE_KEY="$(cat ./secrets/ssh/vps-box-server)"
-export SSH_SERVER_PRIVATE_KEY
-SSH_SERVER_PUBLIC_KEY="$(cat ./secrets/ssh/vps-box-server.pub)"
-export SSH_SERVER_PUBLIC_KEY
-
-# Used for keeping bash variables for run-time substituion instead of execution time substitution.
-# Taken from:
-# https://stackoverflow.com/questions/24963705/is-there-an-escape-character-for-envsubst
-export DOLLAR='$'
-
envsubst < ./ssh.env.conf >> ~/.ssh/config
-envsubst < ./hosts.env > ./hosts
-envsubst < ./docker-compose.env.yaml > ./docker-compose.yaml
-envsubst < ./user-data.env.sh > ./user-data.sh
-envsubst < ./scripts/box/create-backup.env.sh > ./scripts/box/create-backup.sh
-envsubst < ./scripts/box/restore-backup.env.sh > ./scripts/box/restore-backup.sh
+envsubst < ./hosts.env > ./generated/hosts
+envsubst < ./docker-compose.env.yaml > ./generated/docker-compose.yaml
+envsubst < ./scripts/box/user-data.env.sh > ./generated/user-data.sh
+envsubst < ./scripts/box/create-backup.env.sh > ./generated/create-backup.sh
+envsubst < ./scripts/box/restore-backup.env.sh > ./generated/restore-backup.sh