Help me with running an app through Jenkins pipeline

Hello guys,

I am learning the fundamentals of Jenkins through udemy and I encountered a problem that’s been bugging me.

I have a webapp that I can run locally on a host where Jenkins is installed. This app is accessible on localhost:8000 without any problems if run it locally from my terminal.

I have tried to do the same through Jenkins pipeline, but the localhost:8000 is sadly not accessible after the build goes through, despite console-output showing that the build itself was successful.

Any pointers what could be wrong/where I have possibly made a mistake? Thanks a lot :slight_smile:

I have attached screenshot of the Jenkinsfile.

Jenkins will kill child all processes from the sh step once the step finished (this is true for other places as well where Jenkins starts external processes usually , e.g. bat, powershell).
When you run the job a second time and your app is still running, it would fail to start it again as the port 8080 is still in use. So you see it is not a good idea to start long running processes and decouple them from Jenkins.