Rev 4161 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bash# resolve links - $0 may be a softlinkPRG="$0"while [ -h "$PRG" ]; dols=`ls -ld "$PRG"`link=`expr "$ls" : '.*-> \(.*\)$'`if expr "$link" : '/.*' > /dev/null; thenPRG="$link"elsePRG=`dirname "$PRG"`/"$link"fidone# Get standard environment variablesPRGDIR=`dirname $(readlink -f "$PRG")`PROJECT_DIR="`dirname ${PRGDIR}`"if [ $# -ne 3 ]thenecho "Missing argument: production or support server IP address"echo "Usage: $0 <production_ip1> <production_ip2> <support_ip>"exit 1fiPROD_SERVERS="$1 $2"SUPPORT_SERVER=$3MAVEN_REPO="${HOME}/.m2/repository"for PROD_SERVER in ${PROD_SERVERS}doecho "Started copying wars to ${PROD_SERVER}"echo "======================================================"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.warecho "Done copying wars to ${PROD_SERVER}"echo "======================================================="doneecho "Started copying wars to ${SUPPORT_SERVER}"echo "======================================================="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.warscp ${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.warscp ${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.warecho "Done copying wars to support server"echo "======================================================="cd ${PROJECT_DIR}echo $PROJECT_DIRSVN_REVISION=`svn info | grep Revision | sed "s/Revision: //"`for PROD_SERVER in ${PROD_SERVERS}dossh ${PROD_SERVER} "echo \"${SVN_REVISION}\">/catalog-dumps/svn.revision"donessh ${SUPPORT_SERVER} "echo \"${SVN_REVISION}\">/catalog-dumps/svn.revision"