Question

I am new to jenkins and trying to configure a server-client scenario using Multijob plugin.

So here's how it should go :

Phase 1: Compilation of the code. In this one a separate project runs in which only compilation shell command is given

Phase 2: Running of Server In this one a shell command project is given to run the server

Phase3 : Running of Client In this one the client command should run

PROBLEM FACED : The project gets paused as the phase 2 never ends (with fail or success). As the server is always running one.

I tried giving the running of client parallel in phase 2 as a diff job but with that sometimes client job starts running before server job. Moreover I have multiple client jobs so it would be wise to create a different phase for them.

Can somebody please help me with the issue.

Was it helpful?

Solution

As phase 2 runs a shell command, I assume the server is running on Linux. Put an ampersand character after the server run command to put the process in background:

run_server &

and phase 2 will complete as soon as the server is launched. You'll probably also want to send the server's console output to a file, e.g.

run_server > server.log 2>&1 &

(the 2>&1 sends stdout and stderr output to the same file)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top