'cordova' command not recognised on Jenkins Windows slave

493 views
Skip to first unread message

Shajimon Paremmal

unread,
Aug 14, 2015, 1:08:43 PM8/14/15
to Jenkins Users
HI,
I'm trying to build a sample mobile app using Apache CORDOVA in the Jenkins Master-Slave environment.
The source files are present on a Jenkins slave running Windows Server 2012.
I've specified the cordova commands in a .bat file and specified its path in the "Execute Windows batch command".

The build fails saying that "'cordova' is not recognized as an internal or external command,operable program or batch file."

I can very well run this batch file from cmd and it runs successfully.
Can anyone help me with this issue?

Additional info:
Contents of the .bat file;

echo Starting the CORDOVA Build process
cd C:\Cordova_Projects\workshop
call cordova platforms remove android
call cordova platforms add android
call cordova plugin add org.apache.cordova.device
call cordova plugin add org.apache.cordova.console
call cordova emulate android

Jenkins work directory on slave - C:\Jenkins_Works
Cordova project directory on slave - C:\Cordova_Projects\workshop

Thanks,
Shaji

Eric Pyle

unread,
Aug 14, 2015, 4:46:39 PM8/14/15
to jenkins...@googlegroups.com
Hi,

Apparently 'cordova' is not on the %PATH% for the user running Jenkins. You may want to manually add the appropriate PATH entries before calling cordova, or you can set build variables in the job definition (Build Environment section, requires Envinject plugin).

Regards,
Eric
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/bacd4605-bf42-4aa3-a1e6-9a0a9339a777%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shajimon Paremmal

unread,
Aug 17, 2015, 6:34:23 AM8/17/15
to Jenkins Users
Thanks for that input, Eric.
I have the nodejs path set in the PATH variable and I can run the cordova commands from command line on the slave machine locally. \the problem occurs only when I run it from Jenkins.

I've installed Envinject plugin. Being a newbie to Jenkins, I'm a bit confused as to how to use it.
Can I use the node level configuration where I unset the system environment variable, copy the contents of my system PATH variable on to a .properties file and specify its path?

In the properties file, should I specify the path to nodejs as CORDOVA_PATH?

Can't see much help on the cordova-Jenkins on the net  too.

Thanks,
Shaji

Eric Pyle

unread,
Aug 17, 2015, 10:50:29 AM8/17/15
to Jenkins Users

I'm not familiar with how to configure cordova, but if you are able to run successfully when logged in interactively, then you must have the proper settings in your user configuration. So yes, I think you are correct that you should be able to use the node level configurations.

Eric

Reply all
Reply to author
Forward
0 new messages