forked from bft-smart/depspace
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_args.sh
37 lines (28 loc) · 916 Bytes
/
build_args.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
#ARG1=DepSpace IP
#ARG2=DepSpace Port
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <IP> <Port>"
exit 1
fi
IP=$1
PORT=$2
CURRENT_DIR=`pwd`
LOG_FILE="$CURRENT_DIR/build.log"
#deleting previous log file
rm -f "$LOG_FILE"
echo "------------------ Installing DepSpacito ------------------" | tee -a "$LOG_FILE"
echo "IP: $IP" | tee -a "$LOG_FILE"
echo "Port: $Port" | tee -a "$LOG_FILE"
echo "Configuring hosts.config..." | tee -a "$LOG_FILE"
rm config/hosts.config
echo "0 $IP $PORT" > config/hosts.config
echo "----------------------- mvn clean ----------------------- " >> $LOG_FILE
echo "Executing: mvn clean"
mvn --quiet clean 2>&1 | tee -a $LOG_FILE
echo "" >> $LOG_FILE
echo "----------------------- mvn install -----------------------" >> $LOG_FILE
echo "Executing: mvn compile"
mvn --quiet compile | tee -a $LOG_FILE
echo "" >> $LOG_FILE
echo "Done. Log file -> $LOG_FILE" | tee -a "$LOG_FILE"