Keeping a build process running after Jenkins job
You put that into your Execute Shell build step, not as a jenkins build process variable (which is what you did with EnvInject plugin in your screenshot)
So, if you are trying to run rails &
, then do:BUILD_ID=dontKillMe rails &
Try with:
( set -e export BUILD_ID=dontKillMe export JENKINS_NODE_COOKIE=dontKillMe rails &) &
start jenkin server by
java -Dhudson.util.ProcessTree.disable=true -jar jenkins.war --httpPort=8090
code to be in jenkinfile which goes in background
stage("Starting API Server"){ withEnv(['BUILD_ID=dontkill']) { sh 'mvn exec:java -Dexec.mainClass="APPLICATION_SERVER.App" & ' } }