Search code examples
node.jsjenkinswebserverpostman

Setting up webserver to test webhooks api via Jenkins


I am executing a bunch of postman APIs using Newman command on Jenkins.

One of those APIs requires a webhook URL in the body:-

{ "webhook_url": "http://localhost:8000" }

which I want to use later on to retrieve the content posted on it.

I tested it on my local machine by creating a local web server using nodeJs which acted as a webhook URL and I could verify/see the content getting echoed on that web server.

But I need help on how to achieve this same thing via Jenkins. In short, I want to:-

  1. Create and Start a web server via Jenkins which I can use as webhook_url
  2. Execute collection of postman APIs and verify content posted on webhook_url
  3. Kill web server

Solution

  • Fixed it by creating webserver image in docker so that I dont have to create, start or kill it via jenkins.