open-nomad/e2e/bin/update

18 lines
581 B
Plaintext
Raw Normal View History

2019-06-04 17:40:46 +00:00
#!/bin/bash
if [ $# -ne 2 ]; then
2019-06-04 17:40:46 +00:00
echo "./upload.sh <source> <destination>"
exit 1
fi
set -e
2019-06-04 17:40:46 +00:00
nodes=$(terraform output -json -state=terraform/terraform.tfstate | jq -r '(.clients,.servers).value[]')
for node in $nodes
do
echo Executing: scp -C -i terraform/keys/*.pem "$1" ubuntu@$node:"$2"
# scp -o StrictHostKeyChecking=accept-new -C -i terraform/keys/*.pem "$1" ubuntu@$node:"$2"
2019-06-04 17:40:46 +00:00
scp -o StrictHostKeyChecking=accept-new -C -i terraform/keys/*.pem "$1" ubuntu@$node:/tmp/uploaded
ssh -i terraform/keys/*.pem ubuntu@$node sudo mv /tmp/uploaded "$2"
done