0
votes

Actually, the main issue is if I start the server then my next commond will never trigger as it always running as zap server in listening mode. Can I run two command line in Jenkins. I have added 2 "Execute Windows batch command" still nothing works. I have added the image in same thread

I have tried by creating a batch file

cd /
cd C:\Program Files\OWASP\Zed Attack Proxy
start java -jar zap-2.6.0.jar

I am getting error as below after using above batch file

Process leaked file descriptors. See https://jenkins.io/redirect/troubleshooting/process-leaked-file-descriptors for more information

https://wiki.jenkins.io/display/JENKINS/Spawning+processes+from+build

I have also use command line arugument directly in "Execute window batch command" like:-

java -jar zap-2.6.0.jar

But the UI of zap is not starting

I have also tried "Windows Exe Runner Plugin"

https://wiki.jenkins.io/display/JENKINS/Windows+Exe+Runner+Plugin

But jenkins not allowing me to put an exe name in configuration. Looks like a bug of jenkins.

I have also tried by adding zap in environmental variable but that also not working.

Now I am out of idea.

The issue is if I am triggering zap.bat it will do not allow another command to run forward as below which is in my batch:-

enter image description here

Additionally, UI of zap is not open as it is open after direct clicking on zap.bat file

I have added 2 "Execute Windows batch command" still nothing works

enter image description here

Any suggestions will be welcome

2

2 Answers

1
votes

Simple - dont start it from the jar!

Start it using the zap.sh or zap.bat scripts we provide as part of the installation :) You'll also probably want to use the -daemon flag.

Or you can use the official ZAP jenkins plugin: https://wiki.jenkins.io/display/JENKINS/zap+plugin

0
votes

I have resolve this issue by creating two jobs in jenkins. The main job trigger the first job.

Follow the steps :-

  1. Go to the configure section of main job

  2. Now add "Trigger/call builds on other projects" from Build option

  3. Add the project name of zombie job

Note :- uncheck the checkbox of "Block until the triggered projects finish their builds".