-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·24 lines (18 loc) · 804 Bytes
/
deploy.sh
File metadata and controls
executable file
·24 lines (18 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
#To deploy from development machine to test pis
# you will need to npm install on each machine after rsyncing
#add as many pi's as you want to the arrray of pi's here:
ssh_alias=( "pi@raspberrypi-1.local" "pi@raspberrypi-2.local" "pi@raspberrypi-3.local" "pi@raspberrypi-4.local" "pi@raspberrypi-5.local" )
site_folder="./*"
remote_folder="~/node-omxplayer-sync"
exclude="node_modules"
for i in "${ssh_alias[@]}"
do
echo "+~+~+~+~+~+~+~+~+~+~+~+~+~+"
echo $i
rsync --exclude ${exclude} -a ${site_folder} ${i}:${remote_folder} -v
done
# rsync --exclude ${exclude} -a ${site_folder} ${ssh_alias2}:${remote_folder} -v
#try to fix this....
# ssh -t ${ssh_alias} "cd $remote_folder && npm install"
# ssh ${ssh_alias} 'bash -l -c "source /home/pi/.bashrc; cd $remote_folder; npm install"'