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配置

 

 

 

 

 

posted on 2023-04-07 18:04  王飞侠  阅读(11)  评论(0编辑  收藏  举报

导航