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:
i calling shell script(stopbroker.sh) check on specific port if broker running. if yes, killing in script
taking latest changes git , building it
- 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
Post a Comment