0

I am using Jenkins to run my SoapUI project but I built separate "Execute Windows Batch Command" in jenkins for each project. For example, there are 10 different projects and i need to have 10 "Execute Windows Batch Command" in a job. How can I combine 2 or more command inside one "Execute windows batch Command" so i can run all projects in one job?

first project:

    "C:\Program Files\SmartBear\ReadyAPI-2.6.0\bin\testrunner.bat" - 
    sREG_Agreement_GetAgreementv1 -r -a -j -J -fC:\Project\ESB_RegressionReport "- 
    RJUnit-Style HTML Report" -FXML -EUAT 
    C:\Project\ESB_Regression_GitHub\SoapUIProjects\Agreement-GetAgreement-v1- 
    soapui-project.xml

Second project:

    "C:\Program Files\SmartBear\ReadyAPI-2.6.0\bin\testrunner.bat" - 
    sREG_Capability_GetCapability_v2 -r -a -j -J -fC:\Project\ESB_RegressionReport 
    "-RJUnit-Style HTML Report" -FXML -EUAT 
    C:\Project\ESB_Regression_GitHub\SoapUIProjects\Capability_GetCapability_v2- 
    soapui-project.xml

All the command can be written in one Execute Windows Batch Command.

GBouffard
  • 1,125
  • 4
  • 11
  • 24
WSC
  • 1
  • 2
  • 2
    The command lines entered in job configuration in Jenkins are written by Jenkins running on Windows into a temporary created batch file which is processed next by `cmd.exe` started by Jenkins. Jenkins deletes the batch file after started `cmd.exe` terminated itself. If there are multiple command lines which run a batch file, the command `call` must be used for that reason, i.e. the batch file must be __called__ from within the batch file created by Jenkins. See [this answer](https://stackoverflow.com/a/24725044/3074564) for details about how to run another batch file from within a batch file. – Mofi Oct 03 '19 at 17:33

1 Answers1

-1

Perhaps I'm misunderstanding the question, but Execute Shell and Execute Windows Batch Command build steps are typically used to write scripts within them and not just execute a single command. So you can just run them both within the same Execute Windows Batch Command block. e.g.

"C:\Program Files\SmartBear\ReadyAPI-2.6.0\bin\testrunner.bat" - 
sREG_Agreement_GetAgreementv1 -r -a -j -J -fC:\Project\ESB_RegressionReport "- 
RJUnit-Style HTML Report" -FXML -EUAT 
C:\Project\ESB_Regression_GitHub\SoapUIProjects\Agreement-GetAgreement-v1- 
soapui-project.xml

"C:\Program Files\SmartBear\ReadyAPI-2.6.0\bin\testrunner.bat" - 
sREG_Capability_GetCapability_v2 -r -a -j -J -fC:\Project\ESB_RegressionReport 
"-RJUnit-Style HTML Report" -FXML -EUAT 
C:\Project\ESB_Regression_GitHub\SoapUIProjects\Capability_GetCapability_v2- 
soapui-project.xml

...