build_financial_serv.sh 724 Bytes
#!/bin/bash
finance_dir=`pwd`
script_dir=$(cd `dirname $0`; pwd)
prj_name="finance_serv"
src_dir=$script_dir/../code/$prj_name

echo "cd $src_dir"
cd $src_dir
echo "============= start building new files.================"
mvn package
if [ -f ./target/$prj_name-SNAPSHOT.war ]; then
    echo "======= build successful, copy output file to build directory. ======="
    cp ./target/$prj_name-SNAPSHOT.war $script_dir/$prj_name-`date +%Y%m%dT%H%M%S`.war
    cp ./target/$prj_name-SNAPSHOT.war $script_dir/../deploy/$prj_name-latest.war
    echo "======= clean build files ======="
    mvn package clean
else
    echo "============ build failed.============"
    exit 1
fi

echo "cd $org_dir"
cd $org_dir