1.登录jenkins
2.新建任务
2.1 增加任务描述
2.2 填写源码信息
2.3 构建触发器(可忽略)
2.4 构建
cd /root/.m2/repository/com/ruiyicloud/datacore
rm -rf health-event-data-core/
cd /root/.jenkins/workspace/health-event
bash mvn_install.sh
cp -f /root/.jenkins/workspace/health-event/target/health-event-1.0.0.jar /mnt/ruiyi-health-api/ruiyi-health-api-platform/modules/health-event/
cd /mnt/ruiyi-health-api/ruiyi-health-api-platform/modules/health-event/
if test $( pgrep -f health-event-1.0.0.jar | wc -l ) -eq 0
then
echo "进程不存在"
else
echo "存在进程"
ps -ef | grep health-event-1.0.0.jar | grep -v "grep" | awk '{print $2}'| xargs kill -9
fi
BUILD_ID=dontKillMe
/usr/local/java/bin/java -server -Xmx512M -Xms512M -Xmn256M -XX:MaxPermSize=512M -XX:PermSize=256M -XX:AutoBoxCacheMax=20000 -Djava.security.egd=file:///dev/urandom -XX:+AlwaysPreTouch -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:+CMSClassUnloadingEnabled -XX:+ParallelRefProcEnabled -XX:+CMSScavengeBeforeRemark -Xloggc:/mnt/ruiyi-health-api/ruiyi-health-api-platform/modules/health-event/logs/gc.log -XX:+PrintGCDateStamps -XX:+PrintGCDetails -jar health-event-1.0.0.jar > /dev/null 2>&1 &echo $! > tpid
2.5 点击应用保存
2.6 立即构建
3. 效果展示