多服务器部署脚本
#!/bin/bash JENKINS_HOST=10.5.56.128 JENKINS_PROJECT_PARENT=`pwd` PROJECT_NAME=tl-web-tools PROJECT_PATH=$JENKINS_PROJECT_PARENT/tl-web/$PROJECT_NAME/target/$PROJECT_NAME.tar.gz hosts=' 10.5.56.110 10.5.56.111 ' for h in $hosts do ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $h << eeooff cd /var/www/ scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $JENKINS_HOST:$PROJECT_PATH ./ tar -zxvf $PROJECT_NAME.tar.gz cd /var/www/$PROJECT_NAME/bin sh restart.sh eeooff done