Hello, I am deploying a Node.js application to a single Windows machine using Octopus 3.2.19 and am attempting to start it using forever. Here is my deployment script:
npm install forever
node node_modules/forever/bin/forever stopall
node node_modules/forever/bin/forever start ./main.js
Write-Host "Done."
Here is the output from the last three commands:
10:38:23 info: No forever processes running
10:38:24 info: Forever processing file: ./main.js
10:38:24 Done.
The script is successful and my application starts running. However, the build task never finishes. It will remain on this task until the deployment is cancelled, and after cancelling, subsequent deployments indicate that the tentacle is busy, and a service restart/machine reboot is required before another deployment can start.
I have run my script on the machine via RDP using Calamari run-script
, and the script processes successfully and exits as expected.
While debugging, I ran the following deployment script:
npm install forever
node node_modules/forever/bin/forever stopall
node node_modules/forever/bin/forever start ./main.js
node node_modules/forever/bin/forever stopall
Write-Host "Done."
Notice that forever is now instructed to stop all scripts after starting my script. All commands execute and return as expected, however, the task now does finish. This leads me to believe that Octopus is detecting the process that forever is creating, and is expecting it to end before it allows the build task to finish.
I am looking for guidance on solving this issue, I can’t seem to make any progress with it. Any suggestions are welcome. Thanks!