Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keeping a build process running after Jenkins job

I am trying to keep a web process running after the Jenkins job is done.

I looked into ProcessTreeKiller and have tried using BuildId as below, but it doesn't seem to work:

BUILD_ID=dontKillMe /usr/apache/bin/httpd

My command (which I want to keep it running):

rails s &

How can I fix this issue ?

enter image description here

like image 325
Jason Avatar asked Feb 07 '15 23:02

Jason


2 Answers

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 &

like image 193
Slav Avatar answered Oct 04 '22 22:10

Slav


Try with:

(
  set -e
  export BUILD_ID=dontKillMe
  export JENKINS_NODE_COOKIE=dontKillMe
  rails &
) &
like image 26
Eduardo Cuomo Avatar answered Oct 04 '22 21:10

Eduardo Cuomo