19 lines
596 B
Bash
Executable file
19 lines
596 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
|