Jenkins finished the project after deployment, script execution on the server to restart Tomcat

The premise is in the directory server /rootunder which already has a script restart.sh restart Tomcat.
Jenkins and so on into the configuration - build environment, and then select the "Execute shell script on remote host using ssh", as follows:
Write pictures described here
and then fill in the information in the target machine in SSH site, or choose to configure the machine has been configured ;
the Pre build script fill in the script to be executed before build;
script to be executed after build post build script fill. In order to perform the recording operation is restarted after Jenkins Tomcat constructed so filled here:

#!/bin/bash -ilex
source /etc/profile   #此处也可放入restart.sh文件中
sh ~/restart.sh

Click Save to deploy directly with the Jenkins project, and restart Tomcat, without having to manually start.

Published 46 original articles · won praise 13 · views 60000 +

Guess you like

Origin blog.csdn.net/luliuliu1234/article/details/80932751