0

I am trying to run a bat file to start a server as follows:

cd c:\...\bin
call asadmin start-domain

This should start the server. It works great with command prompt, but it is not working when I am using the same commands with Jenkins. It is a freestyle project.

When I run the build it says "attempting to the start domain..." and then completes the build with status "success", but the server is still not started.

I would be grateful, if someone could guide me in this regard.

Thank you in advance,

Fred

iamsankalp89
  • 4,607
  • 2
  • 15
  • 36
Fred
  • 1
  • 1
  • I presume the `call asadmin start-domain` command starts the server and the returns? After a job is finished, all child processes are killed (see [ProcessTreeKiller](https://wiki.jenkins.io/display/JENKINS/ProcessTreeKiller)). There are hints on how to disable it. Aside from that there should be plugins utilizing the [durable task plugin](https://plugins.jenkins.io/durable-task). – Stefan Hanke Sep 13 '17 at 11:08
  • call asadmin start-domain command starts and returns, but the server is still not started. I had killed all the processes before. But it didn't work either. – Fred Sep 13 '17 at 11:52
  • I used the environment variables by following this link [https://wiki.jenkins.io/display/JENKINS/ProcessTreeKiller], and edited the command as follows: call asadmin start-domain $BUILD_ID=donotKillMe, is it right way to do? Sorry I am a new user to Jenkins, would appreciate if someone could guide me in this regard. – Fred Sep 14 '17 at 07:27
  • I've not done anything like that before - I'd try hard to not have to. Perhaps you can modify the jobs such way that prior to the real job, the server is started, and afterwards stopped. – Stefan Hanke Sep 14 '17 at 14:45
  • Thanks for your reply. But the problem is that in my pipeline I have to stop the server at one step and then start again. – Fred Sep 14 '17 at 15:48

0 Answers0