jenkins编译使用nohup部署进程到后台失败,解决方法

在shell脚本中加入BUILD_ID=dontKillMe

server为二进制文件

bash 复制代码
    #!/bin/bash
    BUILD_ID=dontKillMe
    nohup ./server & 

原理:jenkins默认会在构建完成后杀掉构建过程中shell命令触发的衍生进程。jenkins根据BUILD_ID识别某个进程是否为构建过程的衍生进程,故修改BUILD_ID后,jenkins就无法识别是否为衍生进程,则此进程能在后台保留运行。

相关推荐
serve the people9 小时前
Elasticsearch(1) could you tell me how to use es if i am a beginner
大数据·elasticsearch·jenkins
开发者联盟league1 天前
使用jenkins pipeline将项目打包运行在k8s上报错kubectl: Permission denied
java·kubernetes·jenkins
江华森1 天前
Jenkins 运维管理实战博客大纲
运维·jenkins
X1A0RAN1 天前
解决jenkins(本机部署或容器部署)安全机制【CSP】问题
jenkins·allure报告
烧饼Fighting1 天前
Jenkins自动化编译部署Spring Boot项目
spring boot·自动化·jenkins
serve the people1 天前
Elasticsearch(3) show me some examples
大数据·elasticsearch·jenkins
牛奶咖啡131 天前
CI/CD——通过Jenkins插件实现与K8s集成并部署应用到k8s集群的实践保姆级教程
ci/cd·kubernetes·jenkins·jenkins安装k8s插件·jenkins对k8s配置凭据·jenkins配置pod模板·编写流水线脚本部署应用到k8s
serve the people1 天前
Elasticsearch(4) show me some more advanced content
大数据·elasticsearch·jenkins
兄台の请冷静1 天前
Linux 安装es
linux·elasticsearch·jenkins
江华森2 天前
Jenkins CI/CD 实战博客教程
servlet·ci/cd·jenkins