同步代码

This commit is contained in:
sxu 2024-08-30 16:43:48 +08:00
parent e3ff124d9e
commit 5395f9f3e0
3 changed files with 30 additions and 1 deletions

View File

@ -1,5 +1,6 @@
#!/bin/sh
export deploy_path=/opt/builds/${JOB_NAME}/${BUILD_NUMBER}
#export deploy_path=/opt/builds/${JOB_NAME}/${BUILD_NUMBER}
export deploy_path=/opt/builds/${JOB_NAME}
echo "--------moveFile start--------------"
rm -rf $deploy_path
mkdir -p $deploy_path

View File

@ -5,6 +5,7 @@ pipeline {
JAVA_HOME = '/usr/lib/jvm/jdk1.8.0_381'
JOBNAME="${JOB_NAME}"
JENKINS_NODE_COOKIE = "dontKillMe"
SPRING_PROFILES_ACTIVE = "sgzb_nw_dev"
}
stages {
stage('Check out') {

27
scripts/start.sh Normal file
View File

@ -0,0 +1,27 @@
RESOURCE_NAME=sgzb-modules-material-common-3.0.jar
tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
if [ ${tpid} ]; then
echo 'Stop Process...'
kill -15 $tpid
fi
sleep 5
tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
if [ ${tpid} ]; then
echo 'Kill Process!'
kill -9 $tpid
else
echo 'Stop Success!'
fi
tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
if [ ${tpid} ]; then
echo 'App is running.'
else
echo 'App is NOT running.'
fi
rm -f tpid
nohup java -jar ./$RESOURCE_NAME --spring.profiles.active=sgzb_nw_dev &
echo $! > tpid
echo Start Success!