Commit c5ce8ff4 authored by 智勇's avatar 智勇

merge

parents b18b1a8d 70a37f29
......@@ -125,8 +125,8 @@ else
#sed -i "s#.quantgroup.cn#-$NAMESPACE.liangkebang.com#g" ${config_path}
sed -i "s#xterm.js demo#${SYSTEM_NAME}@${NAMESPACE}#" /home/qg-xterm/demo/index.html
echo "java -Xmx2048m -Xloggc:/tmp/${module_name}_gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Denv=dev -Didc=k8s -Dtest=true -jar ${package_path} --worker 1 --currentWorker 1 -t --server.port=80 --spring.config.location=${config_path} & " > java_command
nohup java -Xmx2048m -Xloggc:/tmp/${module_name}_gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Denv=dev -Didc=k8s -Dtest=true -jar ${package_path} --worker 1 --currentWorker 1 -t --server.port=80 --spring.config.location=${config_path} > /dev/null 2>&1 &
echo "java -Xmx1024m -Xloggc:/tmp/${module_name}_gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Denv=dev -Didc=k8s -Dtest=true -jar ${package_path} --worker 1 --currentWorker 1 -t --server.port=80 --spring.config.location=${config_path} & " > java_command
nohup java -Xmx1024m -Xloggc:/tmp/${module_name}_gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Denv=dev -Didc=k8s -Dtest=true -jar ${package_path} --worker 1 --currentWorker 1 -t --server.port=80 --spring.config.location=${config_path} > /dev/null 2>&1 &
# # waiting for log
# count=0
......
#!/bin/bash
echo "start run java"
current="/home/quant_group"
echo "current: ${current}"
echo "NAMESPACE is $NAMESPACE"
module_name=project
module_path="${current}/${module_name}"
package_path="${module_path}/app.jar"
config_path="${module_path}/application.properties"
log_path="/home/quant_group/logs"
rm -rf ${log_path}/*
echo 192.168.4.50 eos.quantgroups.com >> /etc/hosts
echo 172.17.1.7 apollo-dev.quantgroups.com >> /etc/hosts
echo 172.20.3.11 sentry.quantgroups.com >> /etc/hosts
# echo 172.30.3.206 apollo-dev.quantgroups.com >> /etc/hosts
# echo 172.20.3.11 sentry.quantgroups.com >> /etc/hosts
# echo 192.168.4.3 sonar.quantgroups.com >> /etc/hosts
# echo 192.168.4.117 yapi.quantgroups.com >> /etc/hosts
echo "sed domain from xyqb.com to liangkebang.net"
sed -i "s#.xyqb.com#-$NAMESPACE.liangkebang.net#g" ${config_path}
sed -i "s#.domain.com#-$NAMESPACE.liangkebang.net#g" ${config_path}
# sed -i "s#.quantgroup.cn#-$NAMESPACE.liangkebang.net#g" ${config_path}
# sed -i "s#xterm.js demo#${SYSTEM_NAME}@${NAMESPACE}#" /home/qg-xterm/demo/index.html
namespace="$NAMESPACE"
echo "namespace is $namespace"
echo "unset NAMESPACE" >> ~/.bashrc
echo "alias log='cd logs;tail -500f *log';" >> ~/.bashrc
source ~/.bashrc
# source ~/.bash_profile
basicCmd="java -Xmx512m -XX:CompressedClassSpaceSize=128m -Xloggc:/tmp/${module_name}_gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dtest=true"
debugCmd="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
apolloCmd="-Denv=dev -Didc=k8s -DNAMESPACE=${namespace} -Dapollo.longPollingInitialDelayInMills=200000"
apolloMockCmd="-Denv=dev -Didc=k8s-mock -DNAMESPACE=${namespace} -Dapollo.longPollingInitialDelayInMills=200000"
# -jar选项需要在调试和apollo选项后面
jarCmd="-jar ${package_path} --worker 1 --currentWorker 1 -t --server.port=80"
logCmd="-Dlogging.config=classpath:logback-dev.xml"
finalCmd=""
if [[ $SYSTEM_NAME == 'gu-bei' || $SYSTEM_NAME == 'clotho' ]]; then
if [[ $MOCK == 1 ]];then
finalCmd="$basicCmd $debugCmd $apolloMockCmd $jarCmd --spring.config.location=${config_path}"
else
finalCmd="$basicCmd $debugCmd $apolloCmd $jarCmd --spring.config.location=${config_path}"
fi
elif [[ $SYSTEM_NAME == 'pcm' || $SYSTEM_NAME == 'acs-batch' || $SYSTEM_NAME == 'acs-quartz' || $SYSTEM_NAME == 'acs-service' || $SYSTEM_NAME == 'acs-web' || $SYSTEM_NAME == 'app-server' || $SYSTEM_NAME == 'smart-recruitment' ]]; then
# 不能指定config.location
finalCmd="$basicCmd $debugCmd $apolloCmd $jarCmd"
elif [[ $SYSTEM_NAME == 'xyqb-mall' ]]; then
# xyqb-mall打印调试信息
finalCmd="$basicCmd $debugCmd $logCmd $apolloCmd $jarCmd --spring.config.location=${config_path}"
else
finalCmd="$basicCmd $debugCmd $apolloCmd $jarCmd --spring.config.location=${config_path}"
fi
echo "$finalCmd" > java_command
if [[ $DEBUG == 1 ]]; then
echo 'debug'
nohup $finalCmd &
tail -f ~/.bashrc
else
nohup $finalCmd
fi
echo done!
\ No newline at end of file
#!/bin/sh
echo "start run nodejs"
package_path="/home/quant_group"
echo "NAMESPACE is $NAMESPACE"
echo "cd ${package_path}"
cd ${package_path}
echo "echo host"
echo 192.168.4.50 eos.quantgroups.com >> /etc/hosts
echo 172.17.1.7 apollo-dev.quantgroups.com >> /etc/hosts
# echo 172.20.3.11 sentry.quantgroups.com >> /etc/hosts
echo "tar zxf dist.tgz -C ${package_path}"
tar zxf ${package_path}/dist.tgz -C ${package_path}/
echo "rm -rf ${package_path}/dist.tgz"
rm -rf ${package_path}/dist.tgz
echo "start"
# curl -s "http://172.30.220.22:3003/proconfig/get_info?system_name=${SYSTEM_NAME}&key=start_command" | sh
# tail -f /var/log/*.log
node ./bin/server.js
if [[ $DEBUG == 1 ]]; then
echo 'debug'
tail -f ~/.bashrc
fi
echo done!!!
\ No newline at end of file
#!/bin/sh
echo "start run python"
package_path="/home/quant_group"
echo "NAMESPACE is $NAMESPACE"
echo "cd ${package_path}"
cd ${package_path}
echo "echo host"
echo 172.30.3.209 http://opapi.xyqb.com >> /etc/hosts
echo "tar zxf dist.tgz -C ${package_path}"
tar zxf ${package_path}/dist.tgz -C ${package_path}/
echo "rm -rf ${package_path}/dist.tgz"
rm -rf ${package_path}/dist.tgz
#echo "prepare ~/.pip/pip.conf"
#mkdir -p ~/.pip/
#touch ~/.pip/pip.conf
#echo "[global]" >> ~/.pip/pip.conf
#echo "index-url=https://pypi.tuna.tsinghua.edu.cn/simple" >> ~/.pip/pip.conf
#echo "[install]" >> ~/.pip/pip.conf
#echo "trusted-host=mirrors.aliyun.com" >> ~/.pip/pip.conf
#
#echo "pip intall requirements"
#pip install -r ${package_path}/requirements.txt
echo "sed domain.com to liangkebang.com"
find ${package_path}/ -type f -name "*.conf" | xargs sed -i "s#\.domain\.com#-$NAMESPACE.liangkebang.com#g"
find ${package_path}/ -type f -name "*.conf" | xargs sed -i "s#\.xyqb\.com#-$NAMESPACE.liangkebang.com#g"
echo "sed port from 8999 to 80"
find ${package_path}/ -type f -name "*.py" | xargs sed -i "s#8999#80#g"
echo "start python"
python ./startup.py
tail -f ~/.bashrc
#if [[ $DEBUG == 1 ]]; then
# echo 'debug'
# tail -f ~/.bashrc
#fi
echo done!!!
......@@ -4,15 +4,37 @@ echo "start run ui"
current="/home/quant_group"
echo "current: ${current}"
export NAMESPACE=`cat /var/run/secrets/kubernetes.io/serviceaccount/namespace`
echo "NAMESPACE is $NAMESPACE"
# 运行qa工具
echo "SYSTEM_NAME is $SYSTEM_NAME"
host=`curl -s http://172.30.220.22:3003/proconfig/get_host?system_name=${SYSTEM_NAME}`
host=`curl -s -m 5 "http://qaapi.liangkebang.com/proconfig/get_info?system_name=${SYSTEM_NAME}&key=host_name"`
echo "host: ${host}"
if [[ "$host" == "" || "$host" =~ '0001' ]]; then
echo "获取host异常,请检查 http://qaapi.liangkebang.com/proconfig/get_info?system_name=${SYSTEM_NAME}&key=host_name"
exit -1
fi
for entry in ./*tgz
do
with_ext=$(basename "$entry")
echo ${with_ext}
fname="${with_ext%.*}"
echo "mkdir -p ${current}/$fname"
mkdir -p ${current}/$fname
echo "tar zxf ${current}/$with_ext -C ${current}/$fname"
tar zxf ${current}/$with_ext -C ${current}/$fname
# echo "rm -rf ${package_path}/$with_ext"
# rm -rf ${package_path}/$with_ext
done
curl -sSL http://git.q-gp.com/QA/config_repository/raw/master/yaml/replace.py -o replace.py
curl -sSL http://git.q-gp.com/QA/config_repository/raw/master/yaml/replace_config.yaml -o replace_config.yaml
curl -sSL http://git.quantgroup.cn/QA/config_repository/raw/master/yaml/replace.py -o replace.py
curl -sSL http://git.quantgroup.cn/QA/config_repository/raw/master/yaml/replace_config_tke.yaml -o replace_config.yaml
python replace.py $host;
echo "/usr/bin/openresty -g 'daemon off;'"
......
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