Jenkins Maven Java项目
[root@localhost ~]# cat x2.sh #!/bin/bash rm -rf javaweb appname=$1 pid=`ps -ef | grep $appname | grep 'java -jar' | awk '{printf $2}'` echo $pid if [ -z $pid ]; then echo "$appname not started" else kill -9 $pid echo "$appname stoping..." check=`ps -ef | grep -w $pid | grep java` if [ -z $check ]; then echo "$appname pid:$pid is stop" else echo "$appname stop failed" fi fi
gitLab hook配置