The premise is in the directory server /root
under 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:
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.