• Jenkins+gitLab发布java程序


    1.登录jenkins

    • http://ip:12000

    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. 效果展示

  • 相关阅读:
    HDU
    POJ-1325 Machine Schedule 二分图匹配 最小点覆盖问题
    HDU- 6437.Videos 最“大”费用流 -化区间为点
    曼哈顿最小生成树 全网最全
    牛客 136G-指纹锁 set容器重载
    牛客 136J-洋灰三角 +高中数学博大精深
    数学:矩阵快速幂
    数学:Burnside引理与Pólya定理
    数据结构:树上分块
    数据结构:Bitset
  • 原文地址:https://www.cnblogs.com/wgx519/p/13953773.html
Copyright © 2020-2023  润新知