代码拉取完成,页面将自动刷新
同步操作将从 WeBank/WeIdentity-Build-Tools 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
source ./common/script/common.inc
set -e
applicationFile=${SOURCE_CODE_DIR}/dist/conf/application.properties
buildTool_pid=
running=false
port=$(grep "server\.port" $applicationFile |awk -F "=" '{print $2}')
getPid() {
buildTool_pid=`ps aux|grep "BuildToolApplication" | grep -v grep|awk '{print $2}'|head -1`
}
value=
checkServer() {
getPid
if [ -n "$buildTool_pid" ] ;then
value=$(lsof -i:$port|grep ${buildTool_pid}|awk '{print $2}')
if [ "${value}" == "${buildTool_pid}" ] ;then
running=true
fi;
fi
}
#begin build classpath
if [ ! -d ${SOURCE_CODE_DIR}/dist/web ]; then
mkdir -p ${SOURCE_CODE_DIR}/dist/web
fi
CLASSPATH=${SOURCE_CODE_DIR}/resources:${SOURCE_CODE_DIR}/dist/app/*:${SOURCE_CODE_DIR}/dist/lib/*:${SOURCE_CODE_DIR}/dist/web
#set the application.properties in to classpath
CLASSPATH=${CLASSPATH}:${SOURCE_CODE_DIR}/dist/conf/
getPid;
if [ -n "$buildTool_pid" ];then
echo "-----------------------------------------------"
echo "The weid-build-tools web server has already started. pid = "$buildTool_pid
echo "-----------------------------------------------"
exit 1
fi
#start the application
nohup java ${JAVA_OPTS} -cp "$CLASSPATH" com.webank.weid.app.BuildToolApplication &> /dev/null&
echo -n "starting..."
count=0
while [ ${running} = false ]
do
checkServer
sleep 1
count=$(expr $count + 1)
if [ $count == 30 ]; then
echo "."
break;
fi
echo -n "."
done
echo ""
if [ ${running} = true ];then
echo "-----------------------------------------------------------------"
echo "The weid-build-tools web server started successfully."
echo "The weid-build-tools web server url : http://127.0.0.1:"${port}""
echo "-----------------------------------------------------------------"
else
if [ $count == 30 ]; then
echo "------------------------------------------------------------------------------------------"
echo "The weid-build-tools web server started timeout, please check the log -> ./logs/error.log."
echo "------------------------------------------------------------------------------------------"
exit 1;
fi
echo "-----------------------------------------------------------------------------------------"
echo "The weid-build-tools web server started error, please check the log -> ./logs/error.log."
echo "-----------------------------------------------------------------------------------------"
fi
addEnv() {
sed '/BUILD_TOOL_HOME/d' $1 > $1.tempforinforsuite
cat $1.tempforinforsuite > $1
echo "BUILD_TOOL_HOME=$BUILD_TOOL_HOME" >> $1
echo "export BUILD_TOOL_HOME" >> $1
source $1
}
echo "setting env variables..."
BUILD_TOOL_HOME=`pwd`
export BUILD_TOOL_HOME
cd ~
if [ -f ".bash_profile" ];then
addEnv .bash_profile
elif [ -f ".bash_login" ];then
addEnv .bash_login
else
if [ ! -f ".profile" ]; then
touch .profile
fi
addEnv .profile
fi
echo "setting env successfully."
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。