node.js - Start a node server using shell script from Jenkins job -


i trying automate build , test process project. pre-requisite have broker (node server) running tests executed needs build first.

i following below steps jenkins job:

  1. i calling shell script(stopbroker.sh) check on specific port if broker running. if yes, killing in script

  2. taking latest changes git , building it

  3. i calling script(startbroker.sh) start broker again on specific port.

the problem here if manually go , execute startbroker script terminal jenkins user, node server gets started in background , keeps on running forever. when run jenins job, broker started , killed automatically jenkins job finishes.

my broker script listed below reference:

#! /bin/sh  echo "starting broker"  cd "<broker-directory>"  broker=`node . >> /tmp/broker.log&`  echo "broker started processid $broker"  echo "exiting script" 

please suggest how keep broker running after jenkins job finishes. if remove & startbroker script, broker gets started , keeps on running blocks jenkins job getting completed , other jobs not getting triggered.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -