0
votes

I have a setup up a master and slave on the same machine. The master monitors External Jobs the slave runs a batch script and notifies the master about the same.

I followed the Windows instructions from:
https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+external+jobs

and setup a buld step on the slave as follows:
set JENKINS_HOME=http://localhost:8080/jenkins/
java -jar C:\apache-tomcat-7.0.56\webapps\jenkins\WEB-INF\lib\jenkins-core-1.624.jar "POC_Main_Ext_Job" jenkins_poc_test_1

On building the slave job, I get the following error message in the console output:

Building remotely on MySlave in workspace D:\Temp\Jenkins\workspace\Slave_FreeStyle_1 [Slave_FreeStyle_1] $ cmd /c call C:\Users\ROHIT~1.BIS\AppData\Local\Temp\hudson853358493293228093.bat
D:\Temp\Jenkins\workspace\Slave_FreeStyle_1>set JENKINS_HOME=http://localhost:8080/jenkins/
D:\Temp\Jenkins\workspace\Slave_FreeStyle_1>java -jar C:\apache-tomcat-7.0.56\webapps\jenkins\WEB-INF\lib\jenkins-core-1.624.jar "POC_Main_Ext_Job" jenkins_poc_test_1
http://localhost:8080/jenkins/job/POC_Main_Ext_Job/ is not a valid external job (404 Not Found) D:\Temp\Jenkins\workspace\Slave_FreeStyle_1>exit -1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

However, the above url does work in Jenkins and takes to the corresponding job. Any Idea what I'm doing wrong?

1
Are you in a system environment with proxies? That caused me some pain recently, even though I only worked on localhost. - michaelbahr
I don't think so. Any quick way to verify? - rohit-biswas
The wpad method didn't work for me, but the command "netsh winhttp show proxy" outputs current WinHttp Settings: Direct Access (No Proxy server). So I guess no proxy. - rohit-biswas
I don't think this question belongs here, voting to close. - Michał Szydłowski

1 Answers

0
votes

As you can see I had missed out the user credentials while setting JENKINS_HOME. After adding them it works smoothly.