after merge (mostly tabbing issues)
[satune.git] / deploy-cs.sh
1 #!/bin/bash
2
3 #Terminate the script if even one command fails
4 set -e
5
6 BASE=../
7 SERVERS="dc-8.calit2.uci.edu dc-9.calit2.uci.edu dc-10.calit2.uci.edu dc-11.calit2.uci.edu"
8 REMOTEDIR="/scratch/hamed/"
9 INFILE="constraint_compiler/"
10 SRC="constraint_compiler/src/"
11 OUTFILE=csolver.tar.gz
12 USER=hamed
13
14 cd $BASE
15
16 rm -f $OUTFILE
17 tar -czvf $OUTFILE $INFILE
18
19 for SERVER in $SERVERS; do
20         scp $OUTFILE "$USER@$SERVER:$REMOTEDIR"
21         ssh $USER@$SERVER "cd $REMOTEDIR; sudo rm -r $SRC; tar -xzvf $OUTFILE; cd $SRC; make clean; ./setup.sh"
22 done