Skip to content

Instantly share code, notes, and snippets.

@Jupiterrr
Last active November 20, 2015 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jupiterrr/8199939c3652f3c20bc0 to your computer and use it in GitHub Desktop.
Save Jupiterrr/8199939c3652f3c20bc0 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -u # prevent unbound variables
set -e # terminate on error
PORT=63105
# cat bin/deploy.seash | xargs -0 tmux send -t 0
echo "uploading"
tmux send -t 0 "reset" ENTER
cat bin/files.txt | while read file; do
tmux send -t 0 "upload $file" ENTER
done
rm -f hosts_deploy.txt
tmux send -t 0 "show ip to hosts_deploy.txt" ENTER
while [ ! -f hosts_deploy.txt ]; do sleep 1; done
sed -i .bak "s/$/:$PORT/" hosts_deploy.txt
rm hosts_deploy.txt.bak
tmux send -t 0 "upload hosts_deploy.txt hosts.txt" ENTER
echo "starting vessels"
tmux send -t 0 "run out.repy $PORT" ENTER
cat hosts_deploy.txt
echo "<html><body>" > test.html
cat hosts_deploy.txt | while read host; do
echo "<iframe src=\"http://$host/\" width=500 height=300> </iframe>" >> test.html
done
echo "</body></html>" >> test.html
tmux send -t 0 "list" ENTER
out.repy
footer.html
header.html
jquery.min.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment