jenkins multiple console output - batch-file

I'm fairly new to jenkins. I'm trying to execute two .bat files(or directly two commands) from jenkin, the first one will startup selenium and the second will execute a test file (with protractor).
The problem is that when selenium is started, I no longer have hand to input more commands in the console.
I tried start cmd \k to get to another console, and CALLs for two different .bat file, but the console keeps showing the output the trace of selenium being executed.
How can I jump from the bloking console executing selenium to another console to execute my tests (while selenium is still being executed) ?

You could try something like this:
start powershell ".\IEDriverServer.exe"
Replacing the .exe file name with your executable.

Related

"UnetStack libraries missing" error received when trying to run UnetStack simulation script from command line

I am trying to run my UnetStack simulation script using command line. My simulation file is in the sample folder, and I open a terminal window in the unet folder (where README.txt exists). I followed the README.txt instructions, and I tried to run other simulations script from the sample folder, but I always get the following error:
ERROR: UnetStack libraries missing...
However, everything works well if I run the simulation using IDE. I will be grateful if you help sort out this problem, so I run the simulation through command line.
I tried to run the simulation script using command line. I followed README. txt instructions, but it didn't work.
I tried this: bin/unet samples/super-tdma/e3-network.groovy and many other simulation scripts.
This is to make sure that my question has been posted, as I can't see it within the listed questions.
You can use v1.3 or
In v1.4, Copy all the Items from the folder "UnetID" to the "root folder", then run the simulation.

Multiple terminal window in Jenkins?

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?
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.

Jenkins parameter is getting replaced by a white space

I have a parameterized build (copied from an existing job) in Jenkins. While building, my parameter is getting replaced by a white space. Here I am sharing what I have.
Parameter Name: BuildDate (I tried using %% and ${} but no luck)
Windows batch command:
copy \\Network_drive\dir1\dir2\dir3%BuildDate%\filename*.zip .
Output from Jenkins console:
c:\jenkins\workspace\my_build_job_name>copy \\Network_drive\dir1\dir2\dir3\ \filename*.zip .
\\Network_drive\dir1\dir2\dir3\ \filename*.zip
The system cannot find the path specified. 0 file(s) copied
c:\jenkins\workspace\my_build_job_name>exit 1
Build step 'Execute Windows batch command' marked build as failure
Notifying upstream projects of job completion Finished: FAILURE*
Note: We have a Windows/Linux mixed environment. Whenever we want to run shell scripts, we use Cygwin, batch should directly run.
Finally it turned out that one of the parameters was not populating due to hitting "rebuild last". Re-running the whole pipeline did it work. I still wonder why it was not populating but its all hood now!!!

Can I run play and start server using batch file from command line

Play version 2.1.1
The problem I encounter is I try to run the server within the play console and I don't know if I can do it from the batch file.
C:\
cd C:\dev\work\npadmin\trunk
path=C:\Program Files\Java\jdk1.7.0_79\bin;%PATH%
C:\play-2.1.1\play debug
call run -Dnameprofiler.graph.path=c:/nameprofiler-data/graph2/graph_2015-07-14_08-00-00/ono.db -Dnameprofiler.datapath=c:/nameprofiler-data -Ddataloading=lazy
Up until play debug, everything is fine, I get in the console but I have no output of the 'run' within the console.
...
play! 2.1.1 (using Java 1.7.0_79 and Scala 2.10.0), http://www.playframework.org
> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.
[npadmin] $
Is there any way to do this?
After some trial and error I found a way to enter the debug and run the play app.. it is way too simple.
use 'play debug' and the 'run YOUR_CODE' in the same like:
C:\play-2.1.1\play debug run -Dnameprofiler.graph.path=c:/nameprofiler-data/graph2/graph_2015-07-14_08-00-00/ono.db -Dnameprofiler.datapath=c:/nameprofiler-data -Ddataloading=lazy
Somehow it forces it into play's command and works.

How to print .bat script error into summary section when running a TFS build definition

I'm running a .bat file via the InvokeProcess activity in a build process template.
The file is well executed along within a queued build but the error log (to the console) of my .bat file is not visible in the Summary section of the executed build report.
How can we print our message into this section?
ps.
When I put error command in my .bat file, the build is just continued without any error text displayed. The build even results as succeeded.

Resources