Commit a03ddc7e authored by 智勇's avatar 智勇
parents ee00f8ee 826efb51
...@@ -64,7 +64,7 @@ elif [[ $database_name = 'dujiangyan' ]]; then ...@@ -64,7 +64,7 @@ elif [[ $database_name = 'dujiangyan' ]]; then
port='3310' port='3310'
elif [[ $database_name = 'mall' ]]; then elif [[ $database_name = 'mall' ]]; then
# 白条商城 # 白条商城
sys_table_list='mall_config activity_3c_product ad_detail new_3c_product supplier 3c_product 3c_product_spec apix_phone_recharge_detail apix_recharge_project apix_recharge_project_bak category configuration course_detail_info course_info merchant pay19_recharge_project mall_category product product_sku product_sku_image product_spu product_nature nature_value product_category spu_image product_nature_value goods_after_sale_step goods_after_sale_config' sys_table_list='mall_config activity_3c_product ad_detail new_3c_product supplier 3c_product 3c_product_spec apix_phone_recharge_detail apix_recharge_project apix_recharge_project_bak category configuration course_detail_info course_info merchant pay19_recharge_project mall_category product product_sku product_sku_image product_spu product_nature nature_value product_category spu_image product_nature_value goods_after_sale_step goods_after_sale_config brand'
port='3310' port='3310'
elif [[ $database_name = 'qinqiong' ]]; then elif [[ $database_name = 'qinqiong' ]]; then
# qinqiong # qinqiong
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
database_name=$1 database_name=$1
server_host=$2 server_host=$2
db_sub_backup_folder=$3 db_sub_backup_folder=$3
re_replace_ip=$4
public_ip="139.198.2.95"
ip_last=$5
echo $server_host echo $server_host
cd $db_sub_backup_folder cd $db_sub_backup_folder
...@@ -18,8 +21,8 @@ do ...@@ -18,8 +21,8 @@ do
echo "is replace ip for db_back_file $entry" echo "is replace ip for db_back_file $entry"
sed -i "s/http\:\/\/m.xyqb.com/http\:\/\/${server_host}:7001/g" $entry sed -i "s/http\:\/\/m.xyqb.com/http\:\/\/${server_host}:7001/g" $entry
sed -i "s/https\:\/\/m.xyqb.com/http\:\/\/${server_host}:7001/g" $entry sed -i "s/https\:\/\/m.xyqb.com/http\:\/\/${server_host}:7001/g" $entry
sed -i "s/http\:\/\/bt.xyqb.com/http\:\/\/${server_host}:7002/g" $entry sed -i "s/http\:\/\/bt.xyqb.com/http\:\/\/${server_host}:7050/g" $entry
sed -i "s/https\:\/\/bt.xyqb.com/http\:\/\/${server_host}:7002/g" $entry sed -i "s/https\:\/\/bt.xyqb.com/http\:\/\/${server_host}:7050/g" $entry
sed -i "s/http\:\/\/api.xyqb.com/http\:\/\/${server_host}:7003/g" $entry sed -i "s/http\:\/\/api.xyqb.com/http\:\/\/${server_host}:7003/g" $entry
sed -i "s/https\:\/\/api.xyqb.com/http\:\/\/${server_host}:7003/g" $entry sed -i "s/https\:\/\/api.xyqb.com/http\:\/\/${server_host}:7003/g" $entry
sed -i "s/http\:\/\/r.xyqb.com/http\:\/\/${server_host}:7004/g" $entry sed -i "s/http\:\/\/r.xyqb.com/http\:\/\/${server_host}:7004/g" $entry
...@@ -51,3 +54,15 @@ do ...@@ -51,3 +54,15 @@ do
sed -i "s/http\:\/\/btapi.xyqb.com/http\:\/\/${server_host}:7025/g" $entry sed -i "s/http\:\/\/btapi.xyqb.com/http\:\/\/${server_host}:7025/g" $entry
sed -i "s/https\:\/\/btapi.xyqb.com/http\:\/\/${server_host}:7025/g" $entry sed -i "s/https\:\/\/btapi.xyqb.com/http\:\/\/${server_host}:7025/g" $entry
done done
if [ "$re_replace_ip" = true ]; then
for entry in ./*
do
echo "is replace public ip for $entry"
sed -i "s/${server_host}/${public_ip}/g" $entry
sed -i "s/\:70/:${ip_last}/g" $entry
done
fi
cd ..
rm -rf $db_sub_backup_folder
\ No newline at end of file
...@@ -9,27 +9,28 @@ ...@@ -9,27 +9,28 @@
source ~/.bash_profile source ~/.bash_profile
if [ $# -ne 7 ]; then if [ $# -ne 8 ]; then
echo "---------------" echo "---------------"
echo "source_db_infos:source_db_host: $1, source_db_user: $2" echo "source_db_infos:source_db_host: $1, source_db_user: $2"
echo "target_db_infos:target_db_host: $4, target_db_user: $5" echo "target_db_infos:target_db_host: $4, target_db_user: $5"
echo "sync_db_name: $7" echo "sync_db_name: $7, re_replace_ip: $8"
echo "---参数不正确---" echo "---参数不正确---"
echo "Usage:sh db_schema_sync.sh source_db_host source_db_user source_db_pwd target_db_host target_db_user target_db_pwd sync_db_name" echo "Usage:sh db_schema_sync.sh source_db_host source_db_user source_db_pwd target_db_host target_db_user target_db_pwd sync_db_name"
echo "---------------" echo "---------------"
exit 1 exit 1
fi fi
source_db_host="$1" source_db_host=$1
source_db_user=$2 source_db_user=$2
source_db_pwd='Uiwb@o^fR&nHOa5t' source_db_pwd='Uiwb@o^fR&nHOa5t'
target_db_host="$4" ip_last=$4
target_db_host="192.168.4.$ip_last"
target_db_user=$5 target_db_user=$5
target_db_pwd=$6 target_db_pwd=$6
sync_db_name=$7 sync_db_name=$7
re_replace_ip=$8
work_dir=/home/quant_group/qa-deploy-utils/db-utils work_dir=/home/quant_group/qa-deploy-utils/db-utils
sync_config_folder=~/db_sync_configs sync_config_folder=~/db_sync_configs
...@@ -50,7 +51,8 @@ function db_schema_sync() ...@@ -50,7 +51,8 @@ function db_schema_sync()
sh $work_dir/db_gen_config.sh $source_db_host $source_db_user $source_db_pwd $target_db_host $target_db_user $target_db_pwd $database $config_file_name $db_backup_sub_folders sh $work_dir/db_gen_config.sh $source_db_host $source_db_user $source_db_pwd $target_db_host $target_db_user $target_db_pwd $database $config_file_name $db_backup_sub_folders
echo "Step 2: replace domain name in tables: $database $mysql_host $db_backup_sub_folders" echo "Step 2: replace domain name in tables: $database $mysql_host $db_backup_sub_folders"
sh $work_dir/db_replace_ip.sh $database $target_db_host $db_backup_sub_folders echo "Step 2.1: is re_replace_ip: $re_replace_ip"
sh $work_dir/db_replace_ip.sh $database $target_db_host $db_backup_sub_folders $re_replace_ip $ip_last
echo "Step 3: import basic data from backup file: $database $mysql_host $db_backup_sub_folders" echo "Step 3: import basic data from backup file: $database $mysql_host $db_backup_sub_folders"
sh $work_dir/db_import.sh $database $target_db_host $db_backup_sub_folders sh $work_dir/db_import.sh $database $target_db_host $db_backup_sub_folders
......
...@@ -10,6 +10,11 @@ cd $project_path ...@@ -10,6 +10,11 @@ cd $project_path
project_folder=`find ./ -maxdepth 1 -name "$project_name"` project_folder=`find ./ -maxdepth 1 -name "$project_name"`
if [ -n "$project_folder" ];then if [ -n "$project_folder" ];then
desc=`node $config_server/get_project_config.js -name $project_name -attr desc` desc=`node $config_server/get_project_config.js -name $project_name -attr desc`
type=`node $config_server/get_project_config.js -name $project_name -attr type`
if [ "$type" = "node" ];then
command2=`node $config_server/get_project_config.js -name $project_name -attr command2`
command2
fi
sh $config_server/show_info.sh $project_name pull代码 $desc sh $config_server/show_info.sh $project_name pull代码 $desc
cd ./$project_name cd ./$project_name
git checkout ./ git checkout ./
...@@ -23,7 +28,11 @@ if [ -n "$project_folder" ];then ...@@ -23,7 +28,11 @@ if [ -n "$project_folder" ];then
git pull git pull
else else
echo "Fail to checkout branch $git_branch". echo "Fail to checkout branch $git_branch".
exit 128 <<<<<<< HEAD
exit -1
=======
exit -1
>>>>>>> 4e22e35ad767ef00b82ce39c3a2940fa60e90072
fi fi
else else
echo "checkout default branch master" echo "checkout default branch master"
......
...@@ -12,6 +12,11 @@ function getCode() ...@@ -12,6 +12,11 @@ function getCode()
for project in ${projects[@]} for project in ${projects[@]}
do do
desc=`node $config_server/get_project_config.js -name $project -attr desc` desc=`node $config_server/get_project_config.js -name $project -attr desc`
type=`node $config_server/get_project_config.js -name $project_name -attr type`
if [ "$type" = "node" ];then
command2=`node $config_server/get_project_config.js -name $project_name -attr command2`
command2
fi
cd $project_path cd $project_path
project_folder=`find ./ -maxdepth 1 -name "$project"` project_folder=`find ./ -maxdepth 1 -name "$project"`
if [ -n "$project_folder" ];then if [ -n "$project_folder" ];then
......
...@@ -50,7 +50,7 @@ function restartJavaProject() ...@@ -50,7 +50,7 @@ function restartJavaProject()
echo "-----project:$project while be run command: java -Xmx256m -XX:PermSize64m -Xloggc:/tmp/${project}.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -jar ${project}.jar --worker 1 --currentWorker 1 -t > /dev/null 2>&1 &" echo "-----project:$project while be run command: java -Xmx256m -XX:PermSize64m -Xloggc:/tmp/${project}.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -jar ${project}.jar --worker 1 --currentWorker 1 -t > /dev/null 2>&1 &"
log_name=`node $config_server/get_project_config.js -name $project -attr log_name` log_name=`node $config_server/get_project_config.js -name $project -attr log_name`
mv $project_path/logs/$log_name $project_path/logs/$project-$time.log mv $project_path/logs/$log_name $project_path/logs/$project.log.$time
if [[ $project == "redpacket" ]]; then if [[ $project == "redpacket" ]]; then
echo `java -Xmx512m -XX:PermSize64m -Xloggc:/tmp/${project}.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -jar ${project}.jar --worker 1 --currentWorker 1 -t -ts > /dev/null 2>&1 &` echo `java -Xmx512m -XX:PermSize64m -Xloggc:/tmp/${project}.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -jar ${project}.jar --worker 1 --currentWorker 1 -t -ts > /dev/null 2>&1 &`
......
...@@ -30,7 +30,7 @@ function restartJavaProject() ...@@ -30,7 +30,7 @@ function restartJavaProject()
sleep 2s sleep 2s
fi fi
log_name=`node $config_server/get_project_config.js -name $project -attr log_name` log_name=`node $config_server/get_project_config.js -name $project -attr log_name`
mv $project_path/logs/$log_name $project_path/logs/$project-$time.log mv $project_path/logs/$log_name $project_path/logs/$project.log.$time
config_file=`find ./ -maxdepth 2 -name "application.properties"` config_file=`find ./ -maxdepth 2 -name "application.properties"`
if [ -n "$config_file" ] if [ -n "$config_file" ]
then then
......
#!/bin/bash -ilex
source /etc/profile
project_path=/home/quant_group/jenkins/workspace/XyqbAndroidBuild
StroeApk_path=${project_path}/apk
BuildGradle_file=${project_path}/app/build.gradle
BuildApk_path=${project_path}/build/archives
SourceMarkes_flavors=/home/qa-deploy-utils/qa_shell_script/app/markets.txt
branch_name=$1
product_flavors=$2
cd ${project_path}
function get_code()
{
if [ -z ${branch_name} ]; then
echo "分支为空,已切换默认分支master"
git pull
else
echo "checkout specified branch ${branch_name}"
git checkout -f ${branch_name}
if [ $? = 0 ]; then
echo "成功切换分支${branch_name}"
git pull
else
echo "切换分支${branch_name}失败,请联系管理员查看".
exit -1
fi
fi
}
function replace_config()
{
if [ -f ${BuildGradle_file} ];then
echo "正在替换配置文件,请稍后......"
sed -i "s/apply plugin\: 'newlens'/\/\/apply plugin\: 'newlens'/g" ${BuildGradle_file}
sed -i "s/artifact = 'com.tencent.mm:SevenZip:1.1.13'/\/\/artifact = 'com.tencent.mm:SevenZip:1.1.13'/g" ${BuildGradle_file}
sed -i "s/\/\/path = \"\/usr\/local\/bin\/7za\"/path = \"\/usr\/local\/p7zip_9.20.1\/bin\/7za\"/g" ${BuildGradle_file}
else
echo "${BuildGradle_file} 文件不存在,请联系管理人员查看"
exit -1
fi
}
function build_android()
{
if [[ ! -z ${SourceMarkes_flavors} ]]; then
echo "${product_flavors}" > ${project_path}/markets.txt
else
cp -r ${SourceMarkes_flavors} ${project_path}
echo "构建所有渠道包"
fi
rm -rf ${BuildApk_path}/*
rm -rf ${project_path}/apk/*
cd ${project_path}
pwd
echo "开始使用gradle进行编译该版本的代码"
gradle resguard
if [ $? = 0 ]; then
echo "成功构建APK包".
echo "开始重命名对应的渠道包"
cd ${BuildApk_path}
#if [[ ! -z ${product_flavors} ]]; then
# ApkFile="`find ${BuildApk_path} -name "*${product_flavors}.apk"`"
#else
# ApkFile="`find ${BuildApk_path} -name "*ceshi.apk"`"
#fi
ApkFile="`find ${BuildApk_path} -name "*${product_flavors}.apk"`"
echo "apk名称是:${ApkFile}"
echo "当前路径 `pwd`"
cp -r ${ApkFile} ${StroeApk_path}/${branch_name}_${product_flavors}.apk
else
echo "构建失败,请联系管理员查看".
exit -1
fi
}
function upload_apk()
{
echo "apk正在上传到蒲公英,请等待......"
cd ${StroeApk_path}
echo "当前上传apk包的路径是 `pwd`"
curl -F "file=@${branch_name}_${product_flavors}.apk" -F "uKey=13d17385c02ea9ea994d0c985d87ff32" -F "_api_key=5b09af98d5a8ff43f2f39935fa6bfbc1" https://qiniu-storage.pgyer.com/apiv1/app/upload
if [ $? != 0 ]; then
echo "上传失败,请联系管理员查看"
fi
}
get_code
replace_config
build_android
upload_apk
sanliulingkaifangpingtai
yingyongbaocpd
quantgroup
ceshi
oppo
huawei
anfeng
anzhi
xiaomiyingyongshangcheng
yingyonghui
sougoushoujizhushou
mumayi
jifeng
baidushoufa
wangyi
tengxunkaifangpingtai
meizuyingyongzhongxin
oppo
vivo
leshi
wandoujia
ppzhushou
jinritoutiao
baidufengchao
oppoxinxiliu
guangdiantongcpd
\ No newline at end of file
12 13 14 15 16 17 22 24 50 151 152 12 13 14 15 16 17 22 23 24 50 151 152
...@@ -18,10 +18,15 @@ var users = [{}, { ...@@ -18,10 +18,15 @@ var users = [{}, {
var pClass = function() {}; var pClass = function() {};
pClass.prototype = { pClass.prototype = {
init: function(isActive, projectType, port, projectName, gitPath, logName, configFile, command, nodeVersion, userIndex, desc, auth, command2) { init: function(isActive, projectType, port, projectName, ssh_git, gitPath, logName, configFile, command, nodeVersion, userIndex, desc, auth, command2) {
this.name = projectName; this.name = projectName;
this.type = projectType; this.type = projectType;
if (!ssh_git){
this.git_path = "http://" + users[userIndex].name + ":" + users[userIndex].pwd + "@gitabc.xyqb.com/" + gitPath + "/" + projectName + ".git" this.git_path = "http://" + users[userIndex].name + ":" + users[userIndex].pwd + "@gitabc.xyqb.com/" + gitPath + "/" + projectName + ".git"
}else{
this.git_path = gitPath
}
this.log_name = logName; this.log_name = logName;
this.config_file = configFile; this.config_file = configFile;
this.command = command; this.command = command;
...@@ -48,56 +53,56 @@ pClass.prototype = { ...@@ -48,56 +53,56 @@ pClass.prototype = {
} }
} }
} }
// projectName,projectType,port,gitPath,logName,configFile,command,nodeVersion // projectName,projectType,port,gitPath,logName,configFile,command,nodeVersion false,
new pClass().init(true, "java", "7003", "xyqb", "QG", "xyqb.log", "application.properties", null, null, 2, "现金贷-server",""); new pClass().init(true, "java", "7003", "xyqb", false, "QG", "xyqb.log", "application.properties", null, null, 2, "现金贷-server","");
new pClass().init(true, "java", "7025", "baitiao", "QG", "baitiao.log", "application.properties", null, null, 2, "白条-server",""); new pClass().init(true, "java", "7025", "baitiao", false, "QG", "baitiao.log", "application.properties", null, null, 2, "白条-server","");
new pClass().init(true, "java", "7019", "xyqb-mall", "QG", "mall.log", "application.properties", null, null, 2, "商城后台-server",""); new pClass().init(true, "java", "7019", "xyqb-mall", false, "QG", "mall.log", "application.properties", null, null, 2, "商城后台-server","");
new pClass().init(true, "java", "7010", "xyqb-offline", "QG", "xyqb_offline.log", "application.properties", null, null, 2, "线下业务-server",""); new pClass().init(true, "java", "7010", "xyqb-offline", false, "QG", "xyqb_offline.log", "application.properties", null, null, 2, "线下业务-server","");
new pClass().init(true, "java", "7042", "xyqb-user2", "head_group", "xyqb_user.log", "application.properties", null, null, 2, "用户注册登录-V2-server",""); new pClass().init(true, "java", "7042", "xyqb-user2", true, "git@gitabc.xyqb.com:head_group/xyqb-user2.git", "xyqb_user.log", "application.properties", null, null, 2, "用户注册登录-V2-server","");
new pClass().init(true, "java", "7005", "di-ting", "QG", "di_ting.log", "application.properties", null, null, 2, "风控审计-server",""); new pClass().init(true, "java", "7005", "di-ting", false, "QG", "di_ting.log", "application.properties", null, null, 2, "风控审计-server","");
new pClass().init(true, "java", "7013", "han-gu-guan", "QG", "han-gu-guan.log", "application.properties", null, null, 2, "用户注册登录-V1-server",""); new pClass().init(true, "java", "7013", "han-gu-guan", false, "QG", "han-gu-guan.log", "application.properties", null, null, 2, "用户注册登录-V1-server","");
new pClass().init(true, "java", "7015", "jian-men-guan", "QG", "jian_men_guan.log", "application.properties", null, null, 2, "信审服务-server",""); new pClass().init(true, "java", "7015", "jian-men-guan", false, "QG", "jian_men_guan.log", "application.properties", null, null, 2, "信审服务-server","");
new pClass().init(true, "java", "7028", "black-hole", "QG", "black-hole.log", "application.properties", null, null, 2, "合同中心-server",""); new pClass().init(true, "java", "7028", "black-hole", false, "QG", "black-hole.log", "application.properties", null, null, 2, "合同中心-server","");
new pClass().init(true, "java", "7006", "gu-bei", "QG", "pay-center.log", "application.properties", null, null, 2, "支付中心-server",""); new pClass().init(true, "java", "7006", "gu-bei", false, "QG", "pay-center.log", "application.properties", null, null, 2, "支付中心-server","");
new pClass().init(true, "java", "7023", "xyqb-quartz", "QG", "quartz.log", "application.properties", null, null, 2, "定时任务-server",""); new pClass().init(true, "java", "7023", "xyqb-quartz", false, "QG", "quartz.log", "application.properties", null, null, 2, "定时任务-server","");
new pClass().init(true, "java", "7021", "spider-center", "QG", "spider-center.log", "application.properties", null, null, 2, "授信-server",""); new pClass().init(true, "java", "7021", "spider-center", false, "QG", "spider-center.log", "application.properties", null, null, 2, "授信-server","");
new pClass().init(true, "java", "7037", "cash-loan-flow", "QG", "cash_loan_flow.log", "application.properties", null, null, 2, "现金贷流量对接-server",""); new pClass().init(true, "java", "7037", "cash-loan-flow", false, "QG", "cash_loan_flow.log", "application.properties", null, null, 2, "现金贷流量对接-server","");
new pClass().init(true, "java", "7012", "financial-system", "QG", "financial_system.log", "application.properties", null, null, 2, "财务系统-server",""); new pClass().init(true, "java", "7012", "financial-system", false, "QG", "financial_system.log", "application.properties", null, null, 2, "财务系统-server","");
new pClass().init(true, "java", "7034", "fund-manage", "QG", "fund_manage.log", "application.properties", null, null, 2, "债转系统-server",""); new pClass().init(true, "java", "7034", "fund-manage", false, "QG", "fund_manage.log", "application.properties", null, null, 2, "债转系统-server","");
new pClass().init(true, "java", "7029", "gyxd", "QG", "gyxd.log", "application.properties", null, null, 2, "广源小贷-server",""); new pClass().init(true, "java", "7029", "gyxd", false, "QG", "gyxd.log", "application.properties", null, null, 2, "广源小贷-server","");
new pClass().init(true, "java", "7038", "merchant-backend", "QG", "merchant.log", "application.properties", null, null, 2, "商户后台-server","凌子华/陈东亮"); new pClass().init(true, "java", "7038", "merchant-backend", false, "QG", "merchant.log", "application.properties", null, null, 2, "商户后台-server","凌子华/陈东亮");
new pClass().init(true, "java", "7031", "redpacket", "QG", "redpacket.log", "application.properties", null, null, 2, "红包系统-server",""); new pClass().init(true, "java", "7031", "redpacket", false, "QG", "redpacket.log", "application.properties", null, null, 2, "红包系统-server","");
new pClass().init(true, "java", "7044", "finance-api", "bo.wang", "finance-api.log", "application.properties", null, null, 2, "财务系统-server",""); new pClass().init(true, "java", "7044", "finance-api", false, "bo.wang", "finance-api.log", "application.properties", null, null, 2, "财务系统-server","");
new pClass().init(true, "java", "7045", "check-accounts", "QG", "check_accounts.log", "application.properties", null, null, 2, "对账系统-server",""); new pClass().init(true, "java", "7045", "check-accounts", false, "QG", "check_accounts.log", "application.properties", null, null, 2, "对账系统-server","");
new pClass().init(true, "java", "7014", "du-jiang-yan", "QG", "du_jiang_yan.log", "application.properties", null, null, 2, "第三方对接导流-server",""); new pClass().init(true, "java", "7014", "du-jiang-yan", false, "QG", "du_jiang_yan.log", "application.properties", null, null, 2, "第三方对接导流-server","");
// new pClass(true,"java","7027","sms-center","QG","sms-center.log",null,null,null,"短信中心-server"); // new pClass(true,"java","7027","sms-center","QG","sms-center.log",null,null,null,"短信中心-server");
// ui---- // ui----
// projectName,projectType,port,gitPath,logName,configFile,command,nodeVersion // projectName,projectType,port,gitPath,logName,configFile,command,nodeVersion
new pClass().init(true, "ui", "7032", "op-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "运营系统-ui",""); new pClass().init(true, "ui", "7032", "op-ui", false, "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "运营系统-ui","");
new pClass().init(true, "ui", "7040", "activity-ui", "QG", null, "src/app/config.js", "npm run build", "node7", 1, "活动中心-ui",""); new pClass().init(true, "ui", "7040", "activity-ui", false, "QG", null, "src/app/config.js", "npm run build", "node7", 1, "活动中心-ui","");
new pClass().init(true, "ui", "7011", "financial-system-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "财务系统-ui",""); new pClass().init(true, "ui", "7011", "financial-system-ui", false, "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "财务系统-ui","");
new pClass().init(true, "ui", "7030", "gyxd-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "广源小贷-ui"); new pClass().init(true, "ui", "7030", "gyxd-ui", false, "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "广源小贷-ui");
new pClass().init(true, "ui", "7008", "offline-ui", "QG", null, "src/app/config/env.config.js", "npm run build", "node7", 1, "线下白条-ui",""); new pClass().init(true, "ui", "7008", "offline-ui", false, "QG", null, "src/app/config/env.config.js", "npm run build", "node7", 1, "线下白条-ui","");
new pClass().init(true, "ui", "7035", "funding-corp-op-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "白条债转系统-ui",""); new pClass().init(true, "ui", "7035", "funding-corp-op-ui", false, "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "白条债转系统-ui","");
new pClass().init(true, "ui", "7007", "paycenter-ui", "QG", null, "src/app/config/env.config.js", "npm run build", "node7", 1, "支付中心-ui",""); new pClass().init(true, "ui", "7007", "paycenter-ui", false, "QG", null, "src/app/config/env.config.js", "npm run build", "node7", 1, "支付中心-ui","");
new pClass().init(true, "ui", "7043", "xyqb-user-ui", "head_group", null, "src/app/config.js", "npm run qa", "node7", 1, "用户注册登录-V2-ui",""); new pClass().init(true, "ui", "7043", "xyqb-user-ui", false, "head_group", null, "src/app/config.js", "npm run qa", "node7", 1, "用户注册登录-V2-ui","");
new pClass().init(true, "ui", "7039", "merchant-op-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "商户系统-ui",""); new pClass().init(true, "ui", "7039", "merchant-op-ui", false, "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "商户系统-ui","");
new pClass().init(true, "ui", "7004", "di-ting-ui", "QG", null, "client/app/config.js", "grunt build", "node7", 1, "信审-ui",""); new pClass().init(true, "ui", "7004", "di-ting-ui", false, "QG", null, "client/app/config.js", "grunt build", "node7", 1, "信审-ui","");
new pClass().init(true, "ui", "7020", "spider-center-ui", "QG", null, "src/app/config/env.config.js", "npm run qa", "node7", 1, "授信中心-ui",""); new pClass().init(true, "ui", "7020", "spider-center-ui", false, "QG", null, "src/app/config/env.config.js", "npm run qa", "node7", 1, "授信中心-ui","");
new pClass().init(true, "ui", "7050", "qgbc-ui", "QG", null, "src/app/config/env.config.js", "npm run build_production", "node7", 1, "白条-ui",""); new pClass().init(true, "ui", "7050", "qgbc-ui", false, "QG", null, "src/app/config/env.config.js", "npm run build_production", "node7", 1, "白条-ui","");
new pClass().init(true, "ui", "7001", "xyqb-ui", "QG", null, "client/app/config.js", "grunt build", "node4", 1, "现金贷和白条-现金贷-ui",""); new pClass().init(true, "ui", "7001", "xyqb-ui", false, "QG", null, "client/app/config.js", "grunt build", "node4", 1, "现金贷和白条-现金贷-ui","");
new pClass().init(true, "ui", "7046", "activity-op-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "优惠券管理后台-ui",""); new pClass().init(true, "ui", "7046", "activity-op-ui", false, "QG", null, "src/config/env.config.js", "npm run build", "node7", 1, "优惠券管理后台-ui","");
new pClass().init(true, "ui", "7048", "order-op-ui", "OP", null, "src/js/env.config.js", "gulp build", "node7", 1, "订单系统-ui",""); new pClass().init(true, "ui", "7048", "order-op-ui", false, "OP", null, "src/js/env.config.js", "gulp build", "node7", 1, "订单系统-ui","");
new pClass().init(true, "ui", "7002", "bt-ui", "QG", null, "src/app/config/env.config.js", "npm run qa", "node7", 1, "新版白条-ui",""); new pClass().init(true, "ui", "7002", "bt-ui", false, "QG", null, "src/app/config/env.config.js", "npm run qa", "node7", 1, "新版白条-ui","");
// node // node
new pClass().init(true, "node", "7018", "AppBackend", "QG", null, "config/environment/test.js", "forever start -a -s --uid AppBackend bin/www", null, 1, "APP后台服务-server","","forever stop AppBackend"); new pClass().init(true, "node", "7018", "AppBackend", false, "QG", null, "config/environment/test.js", "forever start -a -s --uid AppBackend bin/www", null, 1, "APP后台服务-server","","forever stop AppBackend");
new pClass().init(true, "node", "7041", "activity-op", "QG", null, "src/config.js", "sh start.sh", null, 1, "优惠券中心-server","","sh stop.sh"); new pClass().init(true, "node", "7041", "activity-op", false, "QG", null, "src/config.js", "sh start.sh", null, 1, "优惠券中心-server","","sh stop.sh");
new pClass().init(true, "node", "7047", "op-api", "OP", null, "src/config.js", "sh start.sh", null, 1, "系统Api Gateway-server","","sh stop.sh"); new pClass().init(true, "node", "7047", "op-api", false, "OP", null, "src/config.js", "sh start.sh", null, 1, "系统Api Gateway-server","","sh stop.sh");
new pClass().init(true, "node", "7049", "fe-api", "QG", null, "src/config.js", "sh start.sh", null, 1, "科传项目-消息推送","","pm2 stop fe-api"); new pClass().init(true, "node", "7049", "fe-api", false, "QG", null, "src/config.js", "sh start.sh", null, 1, "科传项目-消息推送","","pm2 stop fe-api");
//python //python
new pClass().init(true, "python", "7022", "qin-qiong", "QG", null, "config/beta/config.properties", null, null, 1, "加密解密-server","",""); new pClass().init(true, "python", "7022", "qin-qiong", false, "QG", null, "config/beta/config.properties", null, null, 1, "加密解密-server","","");
new pClass().init(true, "python", "7033", "xyqb-query", "QG", null, "server/config/beta/config.ini", null, null, 1, "query-server","",""); new pClass().init(true, "python", "7033", "xyqb-query", false, "QG", null, "server/config/beta/config.ini", null, null, 1, "query-server","","");
new pClass().init(false, "python", "7027", "msg-center", "QG", null, "server/config/beta/config.ini", null, null, 1, "短信中心-以前的sms-center","",""); new pClass().init(false, "python", "7027", "msg-center", false, "QG", null, "server/config/beta/config.ini", null, null, 1, "短信中心-以前的sms-center","","");
var temp = ""; var temp = "";
......
...@@ -78,7 +78,9 @@ tranceConfig java "7025" "7003" "192.168.4.152" "baitiao.properties" ...@@ -78,7 +78,9 @@ tranceConfig java "7025" "7003" "192.168.4.152" "baitiao.properties"
tranceConfig node "112233445512345.ittun.com" "activity-op-22.ss.xyqb.loan" "192.168.4.22" "activity-op.js" tranceConfig node "112233445512345.ittun.com" "activity-op-22.ss.xyqb.loan" "192.168.4.22" "activity-op.js"
tranceConfig nginx "7002" "7050" "192.168.4.13" "qgbc-ui.conf" tranceConfig nginx "7002" "7050" "192.168.4.13" "qgbc-ui.conf"
tranceConfig nginx "7050" "7002" "192.168.4.13" "bt-ui.conf" tranceConfig nginx "7050" "7002" "192.168.4.13" "bt-ui.conf"
tranceConfig node "7002" "7050" "192.168.4.12" "AppBackend.js" tranceConfig ui "7002" "7050" "192.168.4.13" "bt-ui.js"
#tranceConfig node "7002" "7050" "192.168.4.12" "AppBackend.js"
#tranceConfig nginx "7002" "7050" "192.168.4.17" "qgbc-ui.conf"
#tranceConfig nginx "7050" "7002" "192.168.4.17" "bt-ui.conf"
#1/bin/bash
cd /home/quant_group/logs
rm -rf *.log.*
for i in `find . -name "*.log"`; do cat /dev/null >$i; done
...@@ -3,43 +3,72 @@ pwd_path="/home/qa-deploy-utils/qa_shell_script" ...@@ -3,43 +3,72 @@ pwd_path="/home/qa-deploy-utils/qa_shell_script"
config_shell_path="$pwd_path" config_shell_path="$pwd_path"
config_server="$pwd_path/config_server" config_server="$pwd_path/config_server"
filename=/home/config_files/special/ngrok_confg.yml filename=/home/config_files/special/ngrok_confg.yml
vipfilename=/home/config_files/special/ngrok_vip_confg.yml
IP_host_first="192.168.4."
ips=`cat $config_server/get_env_ip.sh`
function addFileHead()
{
rm -rf $1
echo "server_addr: ss.xyqb.loan:4443" >> $1
echo "trust_host_root_certs: false" >> $1
echo "tunnels:" >> $1
}
addFileHead $filename
addFileHead $vipfilename
rm -rf $filename
echo "server_addr: ss.xyqb.loan:4443" >> $filename
echo "trust_host_root_certs: false" >> $filename
echo "tunnels:" >> $filename
function addFile() function addFile()
{ {
echo "$1 : $2 " echo "$1 : $2 "
echo " $1-iplast:" >> $filename if [ -n $4 ]
echo " proto:" >> $filename then
echo " http: \"$2\"" >> $filename echo " $1-$4:" >> $3
else
echo " $1-iplast:" >> $3
fi
echo " proto:" >> $3
echo " http: \"$2\"" >> $3
} }
projects=(`node $config_server/get_project_config.js -type java -attr name`) projects=(`node $config_server/get_project_config.js -type java -attr name`)
for project in ${projects[@]} for project in ${projects[@]}
do do
port=`node $config_server/get_project_config.js -name $project -attr port` port=`node $config_server/get_project_config.js -name $project -attr port`
addFile $project $port addFile $project $port $filename
done done
projects=(`node $config_server/get_project_config.js -type ui -attr name`) projects=(`node $config_server/get_project_config.js -type ui -attr name`)
for project in ${projects[@]} for project in ${projects[@]}
do do
port=`node $config_server/get_project_config.js -name $project -attr port` port=`node $config_server/get_project_config.js -name $project -attr port`
addFile $project $port addFile $project $port $filename
done done
projects=(`node $config_server/get_project_config.js -type node -attr name`) projects=(`node $config_server/get_project_config.js -type node -attr name`)
for project in ${projects[@]} for project in ${projects[@]}
do do
port=`node $config_server/get_project_config.js -name $project -attr port` port=`node $config_server/get_project_config.js -name $project -attr port`
addFile $project $port addFile $project $port $filename
done done
projects=(`node $config_server/get_project_config.js -type python -attr name`) projects=(`node $config_server/get_project_config.js -type python -attr name`)
for project in ${projects[@]} for project in ${projects[@]}
do do
port=`node $config_server/get_project_config.js -name $project -attr port` port=`node $config_server/get_project_config.js -name $project -attr port`
addFile $project $port addFile $project $port $filename
done
projects_of_out_proxy=( gu-bei activity-op op-api spider-center )
for ip_last in ${ips[@]}
do
for project in ${projects_of_out_proxy[@]}
do
port=`node $config_server/get_project_config.js -name $project -attr port`
addFile $project $IP_host_first$ip_last:$port $vipfilename $ip_last
done
done done
server_addr: ss.xyqb.loan:4443
trust_host_root_certs: false
tunnels:
xyqb-iplast:
proto:
http: 192.168.4.23:7001
#!/bin/bash
mq_path=/usr/lib/rabbitmq/bin
$mq_path/rabbitmqctl add_user qa qatest
$mq_path/rabbitmqctl set_user_tags qa administrator
$mq_path/rabbitmqctl list_users
#/bin/bash
/usr/lib/rabbitmq/bin/rabbitmqctl stop
/usr/lib/rabbitmq/bin/rabbitmq-server -detached
...@@ -4,4 +4,4 @@ config_file=/home/config_files/special ...@@ -4,4 +4,4 @@ config_file=/home/config_files/special
cp $config_file/msg_center_white_list.py $project_path/server/white_list.py cp $config_file/msg_center_white_list.py $project_path/server/white_list.py
sed -i "s/import json/import json\nfrom white_list import white_list\nfrom white_list import phone_white_list/g" $project_path/server/mq/*.py sed -i "s/import json/import json\nfrom white_list import white_list\nfrom white_list import phone_white_list/g" $project_path/server/mq/*.py
sed -i "s/msg = json.loads(body, \"utf8\")/msg = json.loads(body, \"utf8\")\n if msg[\"source\"] not in white_list:\n logging.info(\"IP:%s不再白名单之列\", msg[\"source\"])\n if msg[\"phoneNo\"] not in phone_white_list:\n logging.info(\"Phone:%s不再白名单之列,短信中心禁止发送该条短信。\", msg[\"phoneNo\"])\n self.acknowledge_message(basic_deliver.delivery_tag)\n return/g" $project_path/server/mq/*.py sed -i "s/msg = json.loads(body, \"utf8\")/msg = json.loads(body, \"utf8\")\n if msg[\"source\"] not in white_list:\n logging.info(\"IP:%s不再白名单之列,将检查手机号白名单\", msg[\"source\"])\n if msg[\"phoneNo\"] not in phone_white_list:\n logging.info(\"Phone:%s不再白名单之列,短信中心禁止发送该条短信。\", msg)\n self.acknowledge_message(basic_deliver.delivery_tag)\n return/g" $project_path/server/mq/*.py
#!/bin/bash #!/bin/bash
IP_host_first="192.168.4." IP_host_first="192.168.4."
public_ip="139.198.2.95" public_ip="139.198.2.95"
pwd_path="/home/qa-deploy-utils/qa_shell_script"
config_server="$pwd_path/config_server"
ips=`cat $config_server/get_env_ip.sh`
mkdir /home/sub_config_file_dont_rm mkdir /home/sub_config_file_dont_rm
for ip_last_num in 12 13 14 15 16 17 22 24 50 151 152 for ip_last_num in ${ips[@]}
do do
cd /home/sub_config_file_dont_rm cd /home/sub_config_file_dont_rm
mkdir ${IP_host_first}${ip_last_num} mkdir ${IP_host_first}${ip_last_num}
...@@ -25,16 +28,10 @@ do ...@@ -25,16 +28,10 @@ do
cp -rf /home/config_files/java/* $dir/public/java/ cp -rf /home/config_files/java/* $dir/public/java/
sed -i "s/target_host_name/${IP_host_first}${ip_last_num}/" $dir/java/* sed -i "s/target_host_name/${IP_host_first}${ip_last_num}/" $dir/java/*
sed -i "s/target_mq_host_name/${IP_host_first}${ip_last_num}/" $dir/java/* sed -i "s/target_mq_host_name/${IP_host_first}${ip_last_num}/" $dir/java/*
# if [ $ip_last_num -lt 100 ]; then
# sed -i "s/target_host_name:7/${public_ip}:${ip_last_num}/g" $dir/public/java/*
# #gu-bei的回调接口都改成外网接口
# sed -i "s/callback=http:\/\/${IP_host_first}${ip_last_num}:7006/callback=http:\/\/${public_ip}:${ip_last_num}006/g" $dir/java/gu-bei.properties
# sed -i "s/pay_notify_url=http:\/\/${IP_host_first}${ip_last_num}:7006/pay_notify_url=http:\/\/${public_ip}:${ip_last_num}006/g" $dir/java/gu-bei.properties
# else
sed -i "s/target_host_name:70/${public_ip}:${ip_last_num}/g" $dir/public/java/* sed -i "s/target_host_name:70/${public_ip}:${ip_last_num}/g" $dir/public/java/*
#gu-bei的回调接口都改成外网接口 #gu-bei的回调接口都改成外网接口
sed -i "s/callback=http:\/\/${IP_host_first}${ip_last_num}:7006/callback=http:\/\/${public_ip}:${ip_last_num}06/g" $dir/java/gu-bei.properties #sed -i "s/callback=http:\/\/${IP_host_first}${ip_last_num}:7006/callback=http:\/\/${public_ip}:${ip_last_num}06/g" $dir/java/gu-bei.properties
sed -i "s/pay_notify_url=http:\/\/${IP_host_first}${ip_last_num}:7006/pay_notify_url=http:\/\/${public_ip}:${ip_last_num}06/g" $dir/java/gu-bei.properties #sed -i "s/pay_notify_url=http:\/\/${IP_host_first}${ip_last_num}:7006/pay_notify_url=http:\/\/${public_ip}:${ip_last_num}06/g" $dir/java/gu-bei.properties
# fi # fi
sed -i "s/target_host_name/${public_ip}/g" $dir/public/java/* sed -i "s/target_host_name/${public_ip}/g" $dir/public/java/*
sed -i "s/target_mq_host_name/${IP_host_first}${ip_last_num}/" $dir/public/java/* sed -i "s/target_mq_host_name/${IP_host_first}${ip_last_num}/" $dir/public/java/*
...@@ -43,6 +40,9 @@ do ...@@ -43,6 +40,9 @@ do
sed -i "s/redis.master.host=${public_ip}/redis.master.host=${IP_host_first}${ip_last_num}/g" $dir/public/java/* sed -i "s/redis.master.host=${public_ip}/redis.master.host=${IP_host_first}${ip_last_num}/g" $dir/public/java/*
sed -i "s/zk.connect.url=${public_ip}/zk.connect.url=${IP_host_first}${ip_last_num}/g" $dir/public/java/* sed -i "s/zk.connect.url=${public_ip}/zk.connect.url=${IP_host_first}${ip_last_num}/g" $dir/public/java/*
sed -i "s/ip_last/$ip_last_num/g" $dir/public/java/*
sed -i "s/ip_last/$ip_last_num/g" $dir/java/*
cp -rf /home/config_files/special/* $dir/special/ cp -rf /home/config_files/special/* $dir/special/
sed -i "s/iplast/${ip_last_num}/g" $dir/special/ngrok_confg.yml sed -i "s/iplast/${ip_last_num}/g" $dir/special/ngrok_confg.yml
...@@ -51,11 +51,17 @@ do ...@@ -51,11 +51,17 @@ do
mkdir $dir/python mkdir $dir/python
cp -rf /home/config_files/python/* $dir/python/ cp -rf /home/config_files/python/* $dir/python/
sed -i "s/target_host_name/${IP_host_first}${ip_last_num}/" $dir/python/* sed -i "s/target_host_name/${IP_host_first}${ip_last_num}/" $dir/python/*
sed -i "s/ip_last/$ip_last_num/g" $dir/python/*
#node项目发布 #node项目发布
rm -rf $dir/node rm -rf $dir/node
mkdir $dir/node mkdir $dir/node
cp -rf /home/config_files/node/* $dir/node/ cp -rf /home/config_files/node/* $dir/node/
sed -i "s/target_host_name/${IP_host_first}${ip_last_num}/" $dir/node/* sed -i "s/target_host_name/${IP_host_first}${ip_last_num}/" $dir/node/*
sed -i "s/ip_last/$ip_last_num/g" $dir/node/*
#ui配置发布 #ui配置发布
rm -rf $dir/ui rm -rf $dir/ui
mkdir $dir/ui mkdir $dir/ui
...@@ -72,6 +78,8 @@ do ...@@ -72,6 +78,8 @@ do
fi fi
sed -i "s/target_host_name/${public_ip}/g" $dir/public/ui/* sed -i "s/target_host_name/${public_ip}/g" $dir/public/ui/*
sed -i "s/${public_ip}:3306/${IP_host_first}${ip_last_num}:3306/g" $dir/public/ui/* sed -i "s/${public_ip}:3306/${IP_host_first}${ip_last_num}:3306/g" $dir/public/ui/*
sed -i "s/ip_last/$ip_last_num/g" $dir/public/ui/*
sed -i "s/ip_last/$ip_last_num/g" $dir/ui/*
#ngxin conf.d发布 #ngxin conf.d发布
rm -rf $dir/nginx_conf.d rm -rf $dir/nginx_conf.d
......
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