I am setting continuous integration using Jenkins server for my Node.js application. For deployment I am using a powershell script and for that I have installed powershell plug-in. The script will need to perform the following tasks in the order.
# Step1
# Stop all the currently running services on web server. For that I am trying to
# execute maintenance.js remotely from the build server under node
node \\SharedWebServerFolder\Utilities\maintenance.js stopServices
# Step2
# Copies all the resources to server at \\SharedServerWebFolder
# Step3
# Start the services
node \\SharedWebServerFolder\Utilities\maintenance.js startServices
I have no problem executing Step2. My question is about Step1 and Step3.
Should I execute
maintenance.jsremotely from the build server? Is this even possible? ( Assume I have installed node.js on the build server)Should I have one more PowerShell script on the web server which executes
maintenance.jslocally? So basically deployment script (from build server) will execute remote PowerShell script (which is on web server) and that remote PowerShell script will executemaintenance.jslocally. In this scenario I don't have to install Node.js on the build server.
What is recommended?