• windows环境Jenkins配置与使用(springboot+war包+vue)


    一、后台发布

    1、General配置

     2、源码管理

    3、构建触发器

     4、构建环境

     5、构建

    clean install -Dmaven.test.skip=true -Ptest

     6、Post Steps

    call "C:UsersAdministratorDesktopstopTomcat.bat"
    call "C:UsersAdministratorDesktop
    un-mes.bat"

    stopTomcat.bat
    
    @echo off  
    set CATALINA_HOME=C:javaapache-tomcat-8.5.55
    set CATALINA_BASE=C:javaapache-tomcat-8.5.55
    set CATALINA_TMPDIR=C:javaapache-tomcat-8.5.55
    cd "C:javaapache-tomcat-8.5.55in"
    title Tomcat重啟脚本  
    call shutdown.bat
    ping -n 6 127.1 >nul  
    exit  
    run-mes.bat
    
    @echo off
    set BUILD_ID=dontkillme
    set CATALINA_HOME=C:javaapache-tomcat-8.5.55
    set CATALINA_BASE=C:javaapache-tomcat-8.5.55
    set CATALINA_TMPDIR=C:javaapache-tomcat-8.5.55
    cd "C:javaapache-tomcat-8.5.55webapps"
    if exist "C:javaapache-tomcat-8.5.55webappsmes-api.war" del "C:javaapache-tomcat-8.5.55webappsmes-api.war"
    cd "C:UsersAdministrator.jenkinsjobslh-mesworkspacemes-applications-parentmes-applications-api	arget"
    copy "C:UsersAdministrator.jenkinsjobslh-mesworkspacemes-applications-parentmes-applications-api	argetmes-api.war" "C:javaapache-tomcat-8.5.55webappsmes-api.war"
    if exist "C:javaapache-tomcat-8.5.55webappsmes-api"  rd /s /q "C:javaapache-tomcat-8.5.55webappsmes-api"
    cd "C:javaapache-tomcat-8.5.55in"
    call startup.bat
    ping -n 45 127.1 >nul  
    echo good bye

    二、前台发布

    1、开始配置同上,构建环境

    2、构建

    npm i
    
    npm run build

    call "C:UsersAdministratorDesktopstopTomcat.bat"
    call "C:UsersAdministratorDesktop
    un-mes-web.bat"

    stopTomcat.bat
    
    @echo off  
    set CATALINA_HOME=C:javaapache-tomcat-8.5.55
    set CATALINA_BASE=C:javaapache-tomcat-8.5.55
    set CATALINA_TMPDIR=C:javaapache-tomcat-8.5.55
    cd "C:javaapache-tomcat-8.5.55in"
    title Tomcat重啟脚本  
    call shutdown.bat
    ping -n 6 127.1 >nul  
    exit  
    run-mes-web.bat
    
    @echo off
    set BUILD_ID=dontkillme
    set CATALINA_HOME=C:javaapache-tomcat-8.5.55
    set CATALINA_BASE=C:javaapache-tomcat-8.5.55
    set CATALINA_TMPDIR=C:javaapache-tomcat-8.5.55
    if exist "C:javaapache-tomcat-8.5.55webappsmes"  rd /s /q "C:javaapache-tomcat-8.5.55webappsmes"
    md "C:javaapache-tomcat-8.5.55webappsmes"
    cd "C:UsersAdministrator.jenkinsjobslh-mes-webworkspace"
    xcopy "C:UsersAdministrator.jenkinsjobslh-mes-webworkspacedist*.*" "C:javaapache-tomcat-8.5.55webappsmes" /s /e /c /y /h /r
    cd "C:javaapache-tomcat-8.5.55in"
    call startup.bat
    ping -n 45 127.1 >nul  
    echo good bye

    三、问题记录

    1、进入jenkins启动项目构建后,出现tomacat闪退现象,现象为jenkins会杀死Tomcat进程

    解决方案:bat命令中设置BUILD_ID环境变量,修改BUILD_ID序号,例如:set BUILD_ID=dontkillme

  • 相关阅读:
    49 我素故我在
    91 棋盘游戏
    55 删除数组重复元素
    54 删除数组元素
    C++虚函数, 纯虚函数
    iOS-OC-多态
    C++函数引用形参和非引用形参
    怎么清理Mac 硬盘里的其他
    Vue.js中this.$nextTick()的使用
    data中有嵌套,取值要链式取
  • 原文地址:https://www.cnblogs.com/shaolixin/p/14188537.html
Copyright © 2020-2023  润新知