Commit 7bb3a3d1 authored by 温海元's avatar 温海元

add qa-platform

parent a9ba910b
project_name=$1
tag=$2
target_user='root'
target_ip='172.29.2.3'
target_dir="/home/quant_group/${project_name}"
qaapi='http://172.30.220.22:3003'
git_path=`curl -s "${qaapi}/proconfig/get_info?system_name=${project_name}&key=git_path"`
build_command=`curl -s "${qaapi}/proconfig/get_info?system_name=${project_name}&key=build_command"`
if [ ! -d "$project_name" ];then
echo "not exist"
git clone ${git_path}
cd ./${project_name}
ssh ${target_user}@${target_ip} "mkdir -p ${target_dir}/"
else
echo "exist"
cd ./${project_name}
git pull
fi
npm install
$build_command
tar zcf ${tag}.dist.tgz ./dist/
scp ${tag}.dist.tgz ${target_user}@${target_ip}:${target_dir}
ssh ${target_user}@${target_ip} "mkdir -p ${target_dir}/${tag}"
ssh ${target_user}@${target_ip} "tar zxf ${target_dir}/${tag}.dist.tgz -C /${target_dir}/${tag}"
ssh ${target_user}@${target_ip} "rm -rf ${target_dir}/dist"
ssh ${target_user}@${target_ip} "ln -s ${target_dir}/${tag}/dist/ ${target_dir}/dist"
ssh ${target_user}@${target_ip} "rm -rf ${target_dir}/*.dist.tgz"
rm -rf *.dist.tgz
echo "done"
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