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

update

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