Commit da7961e5 authored by QA-甘 盛聪's avatar QA-甘 盛聪

update

parent 0b1e354c
#!/bin/bash
project_name=$1
branch_name=$2
public_ip=$3
sh 2_get_code_by_type.sh $project_name $branch_name
if [[ $? == 128 ]]; then
echo "Invalid argument to exit"
exit
fi
sh 3_link_config_file_by_type.sh $project_name $public_ip
sh 4_build_by_type.sh $project_name $public_ip
sh 5_restart_by_type.sh $project_name $public_ip
\ No newline at end of file
...@@ -15,21 +15,21 @@ project_type : ${project_type} ...@@ -15,21 +15,21 @@ project_type : ${project_type}
public_ip : ${public_ip} public_ip : ${public_ip}
" "
#初始化脚本环境 #初始化脚本环境
if $init_shell_script ;then #if $init_shell_script ;then
expect -c " # expect -c "
set timeout 10 # set timeout 10
spawn ssh root@${ip} # spawn ssh root@${ip}
expect *ssword* { send !QAZ2wsx\r } # expect *ssword* { send !QAZ2wsx\r }
expect \"]#\" # expect \"]#\"
send \"rm -rf /home/qa-deploy-utils/qa_shell_script\r\" # send \"rm -rf /home/qa-deploy-utils/qa_shell_script\r\"
expect \"]#\" # expect \"]#\"
send \"cd /home\r\" # send \"cd /home\r\"
expect \"]#\" # expect \"]#\"
send \"git clone http://shengcong.gan:12345678@gitabc.xyqb.com/QA/qa-deploy-utils.git\r\" # send \"git clone http://shengcong.gan:12345678@gitabc.xyqb.com/QA/qa-deploy-utils.git\r\"
expect \"]#\" # expect \"]#\"
send \"exit\r\" # send \"exit\r\"
expect eof;" # expect eof;"
fi #fi
...@@ -54,17 +54,7 @@ else ...@@ -54,17 +54,7 @@ else
expect \"]#\" expect \"]#\"
send \"cd /home/qa-deploy-utils/qa_shell_script\r\" send \"cd /home/qa-deploy-utils/qa_shell_script\r\"
expect \"]#\" expect \"]#\"
send \"sh 2_get_code_by_type.sh $project_type $branch_name\r\" send \"sh deploy_project_by_type $project_type $branch_name $public_ip\r\"
set timeout -1
expect \"]#\"
send \"sh 3_link_config_file_by_type.sh $project_type $public_ip\r\"
set timeout -1
expect \"]#\"
send \"sh 4_build_by_type.sh $project_type $public_ip\r\"
set timeout -1
expect \"]#\"
send \"sh 5_restart_by_type.sh $project_type $public_ip\r\"
set timeout -1
expect \"]#\" expect \"]#\"
send \"exit\r\" send \"exit\r\"
expect eof;" expect eof;"
......
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