#!/bin/bash
ip_last=$1
project_name=$2
branch_name=$3
project_type=$4
public_ip=$5
set timeout 1200
ip=192.168.4.$ip_last
echo "参数为：
#init_shell_script: ${init_shell_script}
ip : ${ip}
project_name : ${project_name}
branch_name : ${branch_name}
project_type : ${project_type}
public_ip : ${public_ip}
"
ssh root@${ip} "ifconfig"
if [ -n "$project_name"  ] && [  -n "$branch_name" ]; then
	ssh root@${ip}
	cd /home/qa-deploy-utils/qa_shell_script
	sh /home/qa-deploy-utils/qa_shell_script/deploy_project_by_name.sh $project_name $branch_name $public_ip
else
	ssh root@${ip}
	cd /home/qa-deploy-utils/qa_shell_script
	sh /home/qa-deploy-utils/qa_shell_script/deploy_project_by_type.sh $project_type $branch_name $public_ip
fi

