depot/hack/deploy.sh
Luke Granger-Brown 84f607d7cf *: try setting up automated deploys
This won't work yet, since the deployer user isn't correctly configured,
but this should at least trigger the right sets of things to happen.
2020-05-09 18:53:17 +01:00

19 lines
597 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
echo Dropping files into place as defined by manifest...
while read -r manifest_line; do
IFS='=' read -ra manifest_bits <<< "$manifest_line"
if [[ "${#manifest_bits[@]}" -ne 2 ]]; then continue; fi
echo -e "\t${manifest_bits[1]}"
cp "${!manifest_bits[0]}" "${manifest_bits[1]}"
done <<< "$SECRETS_MANIFEST"
if [ -z ${2+x} ]; then ssh_cmd="ssh"; else ssh_cmd="ssh $2"; fi
echo Syncing repo content to machine "$1"
rsync -e "$ssh_cmd" -avz --exclude='.hg/' ./ "deployer@$1:depot/"
echo Triggering rebuild
$ssh_cmd -t "deployer@$1" rebuilder depot/