deploy.sh 479 B

123456789101112131415161718
  1. #!/usr/bin/expect
  2. spawn scp -r /var/lib/jenkins/workspace/mkcloud-back-end/target/renren-fast.jar root@10.168.57.12:/home/mkcloud
  3. expect "*: "
  4. send "root\r"
  5. expect eof
  6. spawn ssh root@10.168.57.12
  7. expect "*: "
  8. send "root\r"
  9. interact
  10. send "cd /home/mkcloud\r"
  11. send "mv renren-fast.jar mkcloud-new.jar\r"
  12. send "lsof -i:8085| awk 'NR==2' | awk '{print $2}'\r"
  13. send "if [ ! -n \"$PID\" ]; then echo \"There are no processes running on 8085\" else echo \"NOT NULL\" fi"
  14. expect eof