depot/hack/deploy.sh

20 lines
598 B
Bash
Raw Normal View History

#!/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
2020-05-09 22:49:32 +00:00
$ssh_cmd -t "deployer@$1" rebuilder ./depot