Subversion Repositories SmartDukaan

Rev

Rev 4161 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4096 rajveer 1
#!/bin/bash
2
 
3
# resolve links - $0 may be a softlink
4
PRG="$0"
5
 
6
while [ -h "$PRG" ]; do
7
  ls=`ls -ld "$PRG"`
8
  link=`expr "$ls" : '.*-> \(.*\)$'`
9
  if expr "$link" : '/.*' > /dev/null; then
10
    PRG="$link"
11
  else
12
    PRG=`dirname "$PRG"`/"$link"
13
  fi
14
done
15
 
16
# Get standard environment variables
17
PRGDIR=`dirname $(readlink -f "$PRG")`
18
 
19
PROJECT_DIR="`dirname ${PRGDIR}`"
20
 
21
if [ $# -ne 3 ]
22
then
23
	echo "Missing argument: production or support server IP address"
24
	echo "Usage: $0 <production_ip1> <production_ip2> <support_ip>"
25
	exit 1
26
fi
27
 
28
PROD_SERVERS="$1 $2"
29
SUPPORT_SERVER=$3
30
 
31
MAVEN_REPO="${HOME}/.m2/repository"
32
for PROD_SERVER in ${PROD_SERVERS}
33
do
34
	echo "Started copying wars to ${PROD_SERVER}"
35
	echo "======================================================"
36
	scp ${MAVEN_REPO}/in/shop2020/Website/1.0-SNAPSHOT/Website-1.0-SNAPSHOT.war ${PROD_SERVER}:${MAVEN_REPO}/in/shop2020/Website/1.0-SNAPSHOT/Website-1.0-SNAPSHOT.war
37
	echo "Done copying wars to ${PROD_SERVER}"
38
	echo "======================================================="
39
done
40
 
41
echo "Started copying wars to ${SUPPORT_SERVER}"
42
echo "======================================================="
43
scp ${MAVEN_REPO}/in/shop2020/Support/1.0-SNAPSHOT/Support-1.0-SNAPSHOT.war ${SUPPORT_SERVER}:${MAVEN_REPO}/in/shop2020/Support/1.0-SNAPSHOT/Support-1.0-SNAPSHOT.war
44
scp ${MAVEN_REPO}/in/shop2020/Social/1.0-SNAPSHOT/Social-1.0-SNAPSHOT.war ${SUPPORT_SERVER}:${MAVEN_REPO}/in/shop2020/Social/1.0-SNAPSHOT/Social-1.0-SNAPSHOT.war
45
scp ${MAVEN_REPO}/in/shop2020/Crm/1.0-SNAPSHOT/Crm-1.0-SNAPSHOT.war ${SUPPORT_SERVER}:${MAVEN_REPO}/in/shop2020/Crm/1.0-SNAPSHOT/Crm-1.0-SNAPSHOT.war
46
 
47
echo "Done copying wars to support server"
48
echo "======================================================="
49
 
50
cd ${PROJECT_DIR}
51
echo $PROJECT_DIR
52
 
53
SVN_REVISION=`svn info | grep Revision | sed "s/Revision: //"`
54
 
55
for PROD_SERVER in ${PROD_SERVERS}
56
do
57
	ssh ${PROD_SERVER} "echo \"${SVN_REVISION}\">/catalog-dumps/svn.revision"
58
done
59
 
60
ssh ${SUPPORT_SERVER} "echo \"${SVN_REVISION}\">/catalog-dumps/svn.revision"
61
 
62