提交 8f1e4971 authored 作者: chenshiying's avatar chenshiying

[新增] 部署脚本更新

上级 680fbf58
#!/bin/sh
echo '---------------kill_start----------------'
echo "pramas:" $1
params1=$1
echo "pramas1:" $params1
command=$(cat updowncommand.txt)
echo 'command:' $command
if [ -z "$1" ]; then
if [ -z "$params1" ]; then
command='start'
echo 'command reset value:' $command
fi
if [ "$params1" = "stop" ]; then
command='stop'
echo 'command params value:' $command
fi
KILL_PROCESS_NAME='${deployPath}/${deployJar}'
PROCESS_ID=`ps -ef | grep $KILL_PROCESS_NAME | grep -v 'grep' | awk '{print $2}'`
......@@ -29,8 +35,9 @@ echo '---------------start----------------'
nohup /usr/local/java/jdk1.8/bin/java -javaagent:/usr/local/skywalking/agent/skywalking-agent.jar -Dskywalking.trace.ignore_path=/api/v1/rest/event/longpolling -Dskywalking.agent.service_name=loit-${serviceName} -Dskywalking.collector.backend_service=10.0.120.212:11800,10.0.120.143:11800,10.0.120.44:11800 -Xms2g -Xmx2g -jar $KILL_PROCESS_NAME --spring.profiles.active=${springProfilesActive} >/dev/null 2>&1 &
echo '---------------started----------------'
fi
for i in {1..30};do
sleep 1
tail -n5 ${deployPath}/logs/loit-${serviceName}.log
done
fi
#!/bin/sh
command=$(cat updowncommand.txt)
echo 'command:'$command
if [ -z "$1" ]; then
command='start'
echo 'command reset value:' $command
fi
nginxConf="/${nginxConfigName}"
nginxPath="/usr/local/nginx/"
startPath=$nginxPath'conf/conf.d.start'
startConf=$startPath$nginxConf
stopPath=$nginxPath'conf/conf.d.stop'
stopConf=$stopPath$nginxConf
echo 'startConf:'$startConf
if [ "$command" = "stop" ]; then
echo 'test'
if [ -e "$startConf" ]; then
echo 'copy to stop file'
mv $startConf $stopPath
fi
fi
if [ "$command" != "stop" ]; then
if [ -e "$stopConf" ]; then
echo 'copy to start file'
mv $stopConf $startPath
fi
fi
if [ "$command" = "deploy" ]; then
cd ${deployPath}
rm -rf dist/
rm -rf ${serviceNameAbb}/
mkdir -p ${serviceNameAbb}/dist
unzip dist*.zip
cp -r dist/* ${serviceNameAbb}/dist
cp -r dist/static ${serviceNameAbb}/
fi
pid_file=$nginxPath"logs/nginx.pid"
if [ ! -e ${r"${pid_file}"} ]; then
/usr/local/nginx/sbin/nginx
fi
if [ -e ${r"${pid_file}"} ]; then
/usr/local/nginx/sbin/nginx -s reload
fi
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论