Commit feca6ec4 authored by tywldx's avatar tywldx
parents b3654b67 a7a67d50
#!/bin/bash #!/bin/bash
cd $JENKINS_HOME/jobs/$JOB_BASE_NAME/builds/${BUILD_NUMBER} cd $JENKINS_HOME/jobs/$JOB_BASE_NAME/builds/${BUILD_NUMBER}
res=`grep "2_get_code_by_name fail" log` grep "_by_name fail" log
if [ -n "$res" ];then if [ $? = 0 ];then
echo "2_get_code_by_name fail"
exit -1
fi
res=`grep "3_link_config_file_by_name fail" log`
if [ -n "$res" ];then
echo "3_link_config_file_by_name fail"
exit -1
fi
res=`grep "4_build_by_name fail" log`
if [ -n "$res" ];then
echo "4_build_by_name fail"
exit -1
fi
res=`grep "5_restart_by_name fail" log`
if [ -n "$res" ];then
echo "5_restart_by_name fail"
exit -1 exit -1
fi fi
echo "post_build_script finish"
...@@ -10,20 +10,20 @@ function Git_branch(){ ...@@ -10,20 +10,20 @@ function Git_branch(){
set timeout 10 set timeout 10
spawn ssh root@${ip} spawn ssh root@${ip}
expect \"]#\" expect \"]#\"
send \"for x in `find /home/quant_group/ -maxdepth 2 -name .git`;do cd $(dirname $x);echo $(dirname $x):;git branch | grep '*';done\r\" send \"sh /home/qa-deploy-utils/qa_shell_script/script_by_Contorller/find_branch.sh\r\"
set timeout -1 set timeout -1
expect \"]#\" expect \"]#\"
send \"exit\r\" send \"exit\r\"
expect eof;" expect eof;"
else else
echo "查看服务$2的分支 $date" echo "查看$2服务的分支 $date"
expect -c " expect -c "
set timeout 10 set timeout 10
spawn ssh root@${ip} spawn ssh root@${ip}
expect \"]#\" expect \"]#\"
send \"cd /home/quant_group/$2\r\" send \"cd /home/quant_group/$2\r\"
expect \"]#\" expect \"]#\"
send \"git branch\r\" send \"git branch | grep '*';git log -1 | grep Date;\r\"
set timeout -1 set timeout -1
expect \"]#\" expect \"]#\"
send \"exit\r\" send \"exit\r\"
......
for x in `find /home/quant_group/ -maxdepth 2 -name .git`;do cd $(dirname $x);echo $(dirname $x):;git branch | grep '*';git log -1 | grep Date;done
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