#!/usr/bin/env nix-shell #!nix-shell -i bash ../../shell.nix # shellcheck shell=bash set -Eeuo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" cd ../../ echo "Unlocking git-crypt repos and configuring git..." git config --global user.email "${GIT_CI_USER}" git config --global user.name "sr.ht CI" git crypt unlock # Assumes vps-state was already cloned pushd ../vps-state/ git crypt unlock 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 envsubst < ./ssh.env.conf >> ~/.ssh/config 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