node('Centos'){
stage('构建'){
checkout scm
}
stage('部署'){
//sh 'cd /root/workspace/ContinuousIntegration/ && sh ./deploy.sh'
sh '''
export EXEC=/home/wgz/usr/apache-tomcat-7/bin/catalina.sh
$EXEC stop
sleep 5
JENKINS_NODE_COOKIE=dontKillMe nohup $EXEC start &
sleep 30
'''
}
}


↙↙↙阅读原文可查看相关链接,并与作者交流