build-server.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. echo "---- Script Running -----"
  2. echo "in : "$0
  3. echo "$(realpath $(dirname $0)/..)"
  4. SERVER_PATH=$(realpath $(dirname $0)/..)"/sourcecode/server"
  5. if [ ! -d $SERVER_PATH ] ;
  6. then
  7. echo " Using another server path : "
  8. SERVER_PATH=$(realpath $(dirname $0))"/quizapp-be/sourcecode/server"
  9. fi
  10. RAW=`realpath $0`
  11. echo "[SERVER_PATH] $SERVER_PATH"
  12. RES_DIR=$SERVER_PATH"/""src/main/resources"
  13. echo "[RES_DIR] $RES_DIR"
  14. APPDEVPROP=$RES_DIR"/application-dev.properties.example"
  15. echo "[APPDEVPROP] $APPDEVPROP"
  16. DESTPROP=$RES_DIR"/application-dev.properties"
  17. echo "[DESTPROP] $DESTPROP"
  18. APPDEF=$RES_DIR"/application.properties.example"
  19. echo "[APPDEF] $APPDEF"
  20. DESTDEF=$RES_DIR"/application.properties"
  21. echo "[DESTDEF] $DESTDEF"
  22. APPPOM=$SERVER_PATH"/pom.xml"
  23. echo "[APPPOM] $APPPOM"
  24. cd $SERVER_PATH
  25. echo "---- SRC/MAIN ---- at $(pwd)/./src/main"
  26. git checkout ./src/main
  27. echo "---- POM-XML ---- at $(pwd) "
  28. git checkout "pom.xml"
  29. echo "---- Pulling Git Repo ----"
  30. git pull
  31. cp $APPDEF $DESTDEF
  32. sed -ibak "s/2019.x.x/"$(date +%Y.%m.%d.%H.%M.%S)"/" $APPPOM
  33. sed "s/south\.niimei\.com:3306\/xxxxxxxx/xx.xxx.xx:3306\/xxx/" $APPDEVPROP > $DESTPROP
  34. rm -rf $SERVER_PATH"/target"
  35. mvn package -Dmaven.test.skip=true