Multiple terminal window in Jenkins?

2019-07-29 03:49发布

问题:

Recenlty I have started with some Jenkins tutorials to learn about this tool. As an excersise I would like to start my Angular project and run some protractor e2e tests on it.

Normally I would open terminal window, type : npm install, npm start and run protractor tests. I have one issue though to execute this on Jenkins. Command 'npm start' will run my angular application on localhost:4200. That require some time and after that this terminal window is "frozen" there is information that my application is running on localhost but if I want to run tests I need to open another terminal window and type command there.

I don't know how to do this in Jenkins because when I run my project and observe logs, I can see that my project is running and everything is OK, but I cannot type any command to run test because this terminal window is busy with info: webpack: compiled successfully.

Can I somehow open another terminal window during Jenkins build and run command there?

回答1:

Use & at the end of the command that will run it in background and didn't freeze the terminal.

But As per me I don't think if you are running cmd through Jenkins will froze the terminal.

Each build step is a separate process that Jenkins spawns off. They don't share anything, neither current directory, nor environment variables set/changed within the build step in-spite you hard coded the location. Each new build step starts by spawning a new process off the parent process (the one running Jenkins)

Please share some screenshot if & didn't work for you.