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

update

parent ce839871
...@@ -18,14 +18,43 @@ ...@@ -18,14 +18,43 @@
# exit -1 # exit -1
# fi # fi
#done #done
target_ip=$1
IP_host_first="192.168.4." IP_host_first="192.168.4."
config_files=/home/config_files config_files=/home/config_files
for ip_last_num in 12 13 14 15 16 17 24 151
do if [[ target_ip == "ALL" ]]; then
expect -c " for ip_last_num in 12 13 14 15 16 17 24 151
do
expect -c "
set timeout 10
spawn ssh root@${IP_host_first}${ip_last_num}
expect *ssword* { send !QAZ2wsx\r }
expect \"]#\"
send \"mkdir -p /home/qa-deploy-utils/qa_shell_script\r\"
set timeout -1
expect \"]#\"
send \"mount -t nfs 192.168.4.3:/home/qa-deploy-utils/qa_shell_script /home/qa-deploy-utils/qa_shell_script\r\"
set timeout -1
expect \"]#\"
send \"umount $config_files\r\"
set timeout -1
expect \"]#\"
send \"rm -rf $config_files\r\"
set timeout -1
expect \"]#\"
send \"mkdir $config_files\r\"
set timeout -1
expect \"]#\"
send \"mount -t nfs 192.168.4.3:/home/sub_config_file_dont_rm/${IP_host_first}${ip_last_num}/ $config_files\r\"
set timeout -1
expect \"]#\"
send \"exit\r\"
expect eof;"
done
else
expect -c "
set timeout 10 set timeout 10
spawn ssh root@${IP_host_first}${ip_last_num} spawn ssh root@${IP_host_first}${target_ip}
expect *ssword* { send !QAZ2wsx\r } expect *ssword* { send !QAZ2wsx\r }
expect \"]#\" expect \"]#\"
send \"mkdir -p /home/qa-deploy-utils/qa_shell_script\r\" send \"mkdir -p /home/qa-deploy-utils/qa_shell_script\r\"
...@@ -48,4 +77,4 @@ do ...@@ -48,4 +77,4 @@ do
expect \"]#\" expect \"]#\"
send \"exit\r\" send \"exit\r\"
expect eof;" expect eof;"
done fi
\ No newline at end of file
...@@ -21,7 +21,7 @@ if [ -n "$project_folder" ];then ...@@ -21,7 +21,7 @@ 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 1 exit 128
fi fi
else else
echo "checkout default branch master" echo "checkout default branch master"
......
...@@ -24,6 +24,7 @@ function getCode() ...@@ -24,6 +24,7 @@ function getCode()
echo "checkout branch $git_branch is ok". echo "checkout branch $git_branch is ok".
else else
echo "Fail to checkout branch $git_branch". echo "Fail to checkout branch $git_branch".
exit 128
fi fi
git pull git pull
else else
......
...@@ -32,6 +32,8 @@ if $init_shell_script ;then ...@@ -32,6 +32,8 @@ if $init_shell_script ;then
expect eof;" expect eof;"
fi fi
if [ -n "$project_name" ] && [ -n "$branch_name" ]; then if [ -n "$project_name" ] && [ -n "$branch_name" ]; then
expect -c " expect -c "
set timeout 10 set timeout 10
...@@ -40,9 +42,6 @@ if [ -n "$project_name" ] && [ -n "$branch_name" ]; then ...@@ -40,9 +42,6 @@ if [ -n "$project_name" ] && [ -n "$branch_name" ]; then
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 1_mount_config_files.sh\r\"
set timeout -1
expect \"]#\"
send \"sh 2_get_code_by_name.sh $project_name $branch_name\r\" send \"sh 2_get_code_by_name.sh $project_name $branch_name\r\"
set timeout -1 set timeout -1
expect \"]#\" expect \"]#\"
......
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