Chris Moore
Chris Moore

Reputation: 177

Jenkins Mac issue

I'm trying to set up Jenkins for continuous integration. At the moment, I'm trying to do something very simple but am running into issues and I'm not sure if I'm doing something wrong or what I'm trying to do just isn't possible.

I currently have a file, which shows up on PC as a Windows batch file and on Mac as a Unix executable file. I run it from Mac and it uses xcodebuild and xcrun to make and share archives.

What I want to do for now is just have Jenkins do this for me (I'll add more stuff later) so I add added a build step and typed in the path to the batch file: users/mcbuild/documents/work/fts/ArchiveFTS.bat

However, when I click build I get this:

Started by user anonymous
Building in workspace /Users/Shared/Jenkins/Home/jobs/FTS Build/workspace
[workspace] $ cmd /c call /var/folders/2n/gysykb914qlgtg2b0flhvh4r00007c/T/hudson6994878138376885970.bat
FATAL: command execution failed
java.io.IOException: Cannot run program "cmd" (in directory "/Users/Shared/Jenkins/Home/jobs/FTS Build/workspace"): error=2, No such file or directory

From searching around, I found a couple of possible solutions:

Had to specify the shell to C\windows\system32\cmd.exe I'm not sure what this means or how to do this, can someone explain this please?

I'm not sure but doesn't it look like Hudson is trying to execute a .bat script on a Unix system? Does that mean what I'm trying to do isn't possible and if not, what are my options please?

Some suggestions involve checking which user you're using Hudson as and maybe changing that I'm not sure what user I am using it as or why it comes up as anonymous Is there an issue with it being anonymous and if so, how do I change it please?

Thanks in advance for your help. If you need any more information please let me know.

Upvotes: 3

Views: 2833

Answers (1)

EricP
EricP

Reputation: 982

It appears that you added a build step of type "Execute Windows batch command", but you are running this job on a Mac. What you need to do is run your xcode/xcrun file from an "Execute shell" build step. If you still have problems, make sure you can manually run the same file from a command prompt on the Mac (not by clicking on it). If you get an error about "Cannot run program sh", you may need to configure the path to sh. Type "which sh" at a command prompt to find out where sh is located. Click on Manage Jenkins, then Configure System, and enter the path under Shell Executable.

Upvotes: 6

Related Questions