echo "---- Script Running -----" echo "in : "$0 echo "$(realpath $(dirname $0)/..)" SERVER_PATH=$(realpath $(dirname $0)/..)"/sourcecode/server" if [ ! -d $SERVER_PATH ] ; then echo " Using another server path : " SERVER_PATH=$(realpath $(dirname $0))"/nursery-be/sourcecode/server" fi RAW=`realpath $0` echo "[SERVER_PATH] $SERVER_PATH" RES_DIR=$SERVER_PATH"/""src/main/resources" echo "[RES_DIR] $RES_DIR" APPDEVPROP=$RES_DIR"/application-dev.properties.example" echo "[APPDEVPROP] $APPDEVPROP" DESTPROP=$RES_DIR"/application-dev.properties" echo "[DESTPROP] $DESTPROP" APPDEF=$RES_DIR"/application.properties.example" echo "[APPDEF] $APPDEF" DESTDEF=$RES_DIR"/application.properties" echo "[DESTDEF] $DESTDEF" APPPOM=$SERVER_PATH"/pom.xml" echo "[APPPOM] $APPPOM" cd $SERVER_PATH echo "---- SRC/MAIN ---- at $(pwd)/./src/main" git checkout ./src/main echo "---- POM-XML ---- at $(pwd) " git checkout "pom.xml" echo "---- Pulling Git Repo ----" git pull cp $APPDEF $DESTDEF sed -ibak "s/2019.x.x/"$(date +%Y.%m.%d.%H.%M.%S)"/" $APPPOM sed "s/south\.niimei\.com:3306\/xxxxxxxx/xx.xxx.xx:3306\/xxx/" $APPDEVPROP > $DESTPROP rm -rf $SERVER_PATH"/target" mvn package -Dmaven.test.skip=true