Commit 8213d9bc authored by kalvin's avatar kalvin

deleteLogs

parent 492e82db
...@@ -77,7 +77,7 @@ if [[ $CLUSTER == "3B" ]]; then ...@@ -77,7 +77,7 @@ if [[ $CLUSTER == "3B" ]]; then
else else
echo "clean ${log_path}/*" echo "clean ${log_path}/*"
#历史遗留问题,抽空fix #历史遗留问题,抽空fix
replaceGitRemote() replaceGitRemote
rm -rf ${log_path}/* rm -rf ${log_path}/*
echo "kill java process" echo "kill java process"
...@@ -154,7 +154,7 @@ else ...@@ -154,7 +154,7 @@ else
echo '替换后的' $remoteGit echo '替换后的' $remoteGit
git remote set-url origin $remoteGit || echo "修改失败" #状态 git remote set-url origin $remoteGit || echo "修改失败" #状态
fi fi
cd .. cd -
} }
fi fi
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
echo "start run lua-ui" echo "start run lua-ui"
package_path="/home/quant_group" package_path="/home/quant_group"
#历史遗留问题,抽空fix
replaceGitRemote
echo "cd ${package_path}" echo "cd ${package_path}"
cd ${package_path} cd ${package_path}
...@@ -55,3 +58,30 @@ nohup node /home/qg-xterm/demo/app.js & ...@@ -55,3 +58,30 @@ nohup node /home/qg-xterm/demo/app.js &
echo "frontail logs/*.log -d -n 1000" echo "frontail logs/*.log -d -n 1000"
frontail /var/log/nginx/*log -n 1000 frontail /var/log/nginx/*log -n 1000
replaceGitRemote(){
originDomain="192.168.3.60"
activeDomain="git.q-gp.com"
gdir=/home/qg-xterm
cd $gdir && echo '进入' $gdir
git rev-parse --is-inside-work-tree 2>&1 1>/dev/null; # 有个不行
if [ $? -ne 0 ]
then
echo "不是git目录 $gdir" $?;
cd ..
continue
fi
remoteUrl=`git config --get remote.origin.url`
echo $remoteUrl | grep $originDomain
if [ $? -eq 0 ]
then
remoteGit="${remoteUrl/$originDomain/$activeDomain}"
echo '替换后的' $remoteGit
git remote set-url origin $remoteGit || echo "修改失败" #状态
fi
cd -
}
\ No newline at end of file
...@@ -5,6 +5,8 @@ package_path="/home/quant_group/project" ...@@ -5,6 +5,8 @@ package_path="/home/quant_group/project"
echo "cd ${package_path}" echo "cd ${package_path}"
cd ${package_path} cd ${package_path}
replaceGitRemote
echo "tar zxf dist.tgz -C ${package_path}" echo "tar zxf dist.tgz -C ${package_path}"
tar zxf ${package_path}/dist.tgz -C ${package_path}/ tar zxf ${package_path}/dist.tgz -C ${package_path}/
...@@ -46,3 +48,30 @@ nohup node /home/qg-xterm/demo/app.js & ...@@ -46,3 +48,30 @@ nohup node /home/qg-xterm/demo/app.js &
echo "frontail logs/*.log -d -n 1000" echo "frontail logs/*.log -d -n 1000"
frontail ./logs/*log -n 1000 frontail ./logs/*log -n 1000
replaceGitRemote(){
originDomain="192.168.3.60"
activeDomain="git.q-gp.com"
gdir=/home/qg-xterm
cd $gdir && echo '进入' $gdir
git rev-parse --is-inside-work-tree 2>&1 1>/dev/null; # 有个不行
if [ $? -ne 0 ]
then
echo "不是git目录 $gdir" $?;
cd ..
continue
fi
remoteUrl=`git config --get remote.origin.url`
echo $remoteUrl | grep $originDomain
if [ $? -eq 0 ]
then
remoteGit="${remoteUrl/$originDomain/$activeDomain}"
echo '替换后的' $remoteGit
git remote set-url origin $remoteGit || echo "修改失败" #状态
fi
cd -
}
\ No newline at end of file
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
echo "deploy xyqp-query" echo "deploy xyqp-query"
package_path="/home/quant_group/project" package_path="/home/quant_group/project"
replaceGitRemote
echo "cd ${package_path}" echo "cd ${package_path}"
cd ${package_path} cd ${package_path}
source ~/.bash_profile source ~/.bash_profile
...@@ -16,3 +18,30 @@ rm -rf ${package_path}/dist.tgz ...@@ -16,3 +18,30 @@ rm -rf ${package_path}/dist.tgz
echo "python run.py --mode=beta --port=80" echo "python run.py --mode=beta --port=80"
python ${package_path}/server/run.py --mode=beta --port=80 python ${package_path}/server/run.py --mode=beta --port=80
replaceGitRemote(){
originDomain="192.168.3.60"
activeDomain="git.q-gp.com"
gdir=/home/qg-xterm
cd $gdir && echo '进入' $gdir
git rev-parse --is-inside-work-tree 2>&1 1>/dev/null; # 有个不行
if [ $? -ne 0 ]
then
echo "不是git目录 $gdir" $?;
cd ..
continue
fi
remoteUrl=`git config --get remote.origin.url`
echo $remoteUrl | grep $originDomain
if [ $? -eq 0 ]
then
remoteGit="${remoteUrl/$originDomain/$activeDomain}"
echo '替换后的' $remoteGit
git remote set-url origin $remoteGit || echo "修改失败" #状态
fi
cd -
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment