代码拉取完成,页面将自动刷新
同步操作将从 夏哥/logserver 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/sh
daemon=true
logfile=logs/all.logs
jarfile=target/logserver.jar
[ ! -e "$jarfile" ] && jarfile=logserver.jar
JVM_OPS="-Xmx72m -Xss228k"
JVM_OPS="$JVM_OPS -DcontextName=logserver"
JVM_OPS="$JVM_OPS -DlogLength=2048"
#ENV_OPS="PATH=/usr/java/jdk1.8.0_161/bin:$PATH"
usage(){
echo "Usage: start.sh ( commands ... )"
echo "commands: "
echo " status check the running status"
echo " start start logserver"
echo " stop stop logserver"
echo " restart stop && start"
echo " clean clean target"
echo " build build logserver.jar"
echo " jars copy dependencies to target"
echo " package build logser.jar and copy dependencies to target"
echo " rebuild stop && build && start"
echo " refresh stop && clean && build && jars && start"
echo " deploy package all to one-fat logserver.jar"
}
status(){
PIDS=`ps -ef | grep java | grep "logserver.jar" |awk '{print $2}'`
if [ -z "$PIDS" ]; then
echo "logserver is not running!"
else
for PID in $PIDS ; do
echo "logserver has pid: $PID!"
done
fi
}
stop(){
PIDS=`ps -ef | grep java | grep "logserver.jar" |awk '{print $2}'`
if [ -z "$PIDS" ]; then
echo "logserver is not running!"
else
echo -e "Stopping logserver ..."
for PID in $PIDS ; do
echo -e "kill $PID"
kill $PID > /dev/null 2>&1
done
fi
}
clean(){
mvn clean
}
jar(){
mvn compile jar:jar
}
dependency(){
mvn dependency:copy-dependencies -DoutputDirectory=target
}
deploy(){
mvn package -Prelease
}
start(){
echo "starting logserver ..."
JVM_OPS="-server -Djava.awt.headless=true $JVM_OPS"
ENV_OPS="$ENV_OPS enableHttps=false"
if [ "$daemon" = "true" ]; then
env $ENV_OPS setsid java $JVM_OPS -Dlogfile=$logfile -jar $jarfile >> /dev/null 2>&1 &
else
env $ENV_OPS java $JVM_OPS -jar $jarfile 2>&1
fi
}
if [ $# -eq 0 ]; then
usage
else
case $1 in
status) status ;;
start) start ;;
stop) stop ;;
restart) stop && start ;;
clean) clean ;;
build) jar ;;
jars) dependency ;;
package) jar && dependency ;;
rebuild) stop && jar && start ;;
refresh) stop && clean && jar && dependency && start ;;
deploy) deploy ;;
*) usage ;;
esac
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。