Running Jenkins Bat Files

I have a simple question. I want to run a bat file that should run post build. The bat file goes to the previousVersion and currentVersion parameters (These parameters are entered as Checking string parameters before the build starts).

Here is what I tried Executing the Windows Command Prompt

set v = %currentVersion% set pv = %previousVersion% cmd \k "C:\jenkins\workspace\mybatfile.bat %pv% %p%" 

The error I get is that cmd is not recognized as an internal or external command running in the program or exiting the batch file 9009

+6
source share
3 answers

Replace "cmd \ k" with "call"

The Execute Windows Batch command is already running inside cmd; no need to specifically launch a new one. Just β€œcall” your BAT file.

+22
source

if you want to run a separate command window, you can try:

 start cmd \k "your\bat" 

here is the link: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

0
source

Create the jenkins.bat file jenkins.bat and place this file where your jenkins.war file is available.

You need to click the jenkins.bat file.

Note. - After clicking on the jenkins.bat file, the jenkins.bat browser will automatically open with the jenkins URL.

 timeout 3 start chrome http://localhost:8080 timeout 3 java -jar jenkins.war 
0
source

Source: https://habr.com/ru/post/913624/


All Articles