Skip to content

Commit

Permalink
Fixed provisioning script for different dir names
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotte committed Nov 27, 2023
1 parent 5c97a3a commit 4d25ed7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ set -e
# Provision a remote server using a Bash script
# Usage example: ./provision.sh provisioning/ user@hostname -p2222

prov_dir="$1"; shift
cd "$1"; shift

if [ ! -f "$prov_dir/main.sh" ]; then
if [ ! -f main.sh ]; then
echo 'File main.sh not found' >&2
exit 1
fi

tar -cvzf- "$prov_dir" | ssh "$@" '
tar -cvzf- . | ssh "$@" '
set -ex
rm -rf /tmp/provisioning
tar -xvzf- -C/tmp
mkdir /tmp/provisioning
tar -xvzf- -C/tmp/provisioning
bash /tmp/provisioning/main.sh || result="$?"
rm -rf /tmp/provisioning
exit "${result:-0}"
Expand Down

0 comments on commit 4d25ed7

Please sign in to comment.