#!/bin/bash
project_name=$1
branch_name=$2
public_ip=$3

sh /home/qa-deploy-utils/qa_shell_script/2_get_code_by_name.sh $project_name $branch_name $4
if [ $? = 0 ]; then
	echo "--- $project_name 2_get_code_by_name ok ---"
else
	echo "--- $project_name 2_get_code_by_name fail ---"
	exit -1
fi
 
sh /home/qa-deploy-utils/qa_shell_script/3_link_config_file_by_name.sh $project_name $public_ip $4
if [ $? = 0 ]; then
	echo "--- $project_name 3_link_config_file_by_name ok ---"
else
	echo "--- $project_name 3_link_config_file_by_name fail ---"
	exit -1
fi

sh /home/qa-deploy-utils/qa_shell_script/4_build_by_name.sh $project_name $public_ip $4
if [ $? = 0 ]; then
	echo "--- $project_name 4_build_by_name ok ---"
else
	echo "--- $project_name 4_build_by_name fail ---"
	exit -1
fi

sh /home/qa-deploy-utils/qa_shell_script/5_restart_by_name.sh $project_name $public_ip $4
if [ $? = 0 ]; then
	echo "--- $project_name 5_restart_by_name ok ---"
else
	echo "--- $project_name 5_restart_by_name fail ---"
	exit -1
fi

