CI/CD for Node.js

Hey guys,
I’m following this CI/CD for Node.js guide to setup Node.js and I’m currently in the step “3.3 Install modules & restart application” and I see there these lines:

npm install
./myapp-restart.sh

Is there any example of what should be part of myapp-restart.sh?

Thanks!

Hi there,
You should enter the commands to restart your app on the server there. Unfortunately, I’m not able to tell you which commands exactly because it depends on your app.

I know it is kinda late, but if you did not figure it out, that .sh script is honestly not mandatory at all. What you actually do in step 3 is what you normally do in order to restart your app manually on the server. In that step it shows you that you are connected on the server, via ssh, so nothing fancy.
The content of the file can be (an example on how I will do this):

kill -9 $(lsof -t -i:port_of_the_node_server)
cd to_your_node_code_main_folder
node index.js # this can be different depending on what you use and how you do it

Hope this helps.