Monday, April 18, 2011

Jenkins OSX installer

Two weeks ago, I started to work on a simple OSX installer for Jenkins. Last week my work was accepted by Kohsuke and submitted to the repository. Now you can find the installer for the lastest Jenkins release here.

What does the installer do?
  • copies the jenkins.war to /Applications/Jenkins
  • create a simple LaunchAgent property file (org.jenkins-ci.plist) and add Jenkins as a service
    with a specific JENKINS_HOME location in /Users/Shared/
  • start the new Jenkins service after the installation finished
That's it basically.

You can find the installer project on github.

21 comments:

Roey said...

How do I ininstall it from my mac?

Unknown said...

You probably want to un-install the stuff, right?
This is (very mac like) a manual process. I can send you the little script that I used for testing purpose. This will be included in one of the next releases of the installer.

BTW: there will be a new installer available soon, that allows the user to install only jenkins and another option to install it as auto start item.

Andrew said...

I used the stand-alone installer on the Jenkins site, and have no idea what it did other than put the .war in /Applications/Jenkins/ If there is some configuration file someplace that I will need to change (because I want to put the file elsewhere), where is it? What is it? Thanks for your work!

Unknown said...

Hi Andrew,

basically you are right about the installer. Currently it copies the war to /Applications/Jenkins and creates the configuration file for the LaunchService. You can find this file in /Library/LaunchAgents/org.jenkins-ci.plist.
This file contains the information about the jenkins.war file. So if you want to change the location, then you can modify it here.
The current installer leaves a lot of room for improvement. There is currently ome work in progress to have a Prefpane for jenkins. This will make changes to the configuration much easier.
If you have an idea for improvement, then drop me an email. I'm happy to get some feedback and make the appropriate changes to meet as much needs as possible.
Thanks.

Anonymous said...

I ran into an issue while trying to use your installer to build iOS apps. Essentially, the user running Jenkins (daemon I think) could not access the Keychain and hence the certificates that match the mobile provisioning profiles. I was getting errors like:

[BEROR]Code Sign error: a valid provisioning profile matching the application's Identifier 'my.app.bundle.id.name'

I solved this by running Jenkins as my user, with loads of credit to this blog post .

Just curious if you can think of a better way and also documenting a work around incase anyone else runs into the same issue.

Unknown said...

I'm glad that you found a work around for your issue.
Perhaps it's a good idea to create a new user to let jenkins run as. I haven't yet thought about this, since you are the first one that reports that kind of issues.
Sure, it would be a good idea in the meantime to add your solution to the readme.
Thanks!

Unknown said...

The installer is great. I had the same issue as @matyjas. Luckily I found this here so that I could get code signing to work.

cr381ve said...

Thank you very much works like a dream!

cr381ve said...

Note to change the port you just need to run the following command:

sudo defaults write /Library/Preferences/org.jenkins-ci httpPort '9990'

Steve G said...
This comment has been removed by the author.
Steve G said...
This comment has been removed by the author.
Steve G said...

After much playing around with and thinking the installer was broken I figured out my issue.

If you get this:
[Winstone 2011/11/03 16:01:00] - Container startup failed
java.io.IOException: Failed to start a listener: winstone.ajp13.Ajp13Listener
at winstone.Launcher.spawnListener(Launcher.java:250)
at winstone.Launcher.(Launcher.java:203)
at winstone.Launcher.main(Launcher.java:398)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at Main._main(Main.java:268)
at Main.main(Main.java:96)
Caused by: java.io.IOException: Failed to listen on port 8009
at winstone.ajp13.Ajp13Listener.start(Ajp13Listener.java:92)
at winstone.Launcher.spawnListener(Launcher.java:241)
... 8 more
Caused by: java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.(ServerSocket.java:194)
at java.net.ServerSocket.(ServerSocket.java:150)
at winstone.ajp13.Ajp13Listener.start(Ajp13Listener.java:87)
... 9 more

Exception in thread "pool-2-thread-2" java.lang.NullPointerException
at org.jvnet.hudson.reactor.Reactor$1.run(Reactor.java:153)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Nov 3, 2011 4:01:00 PM hudson.WebAppMain$2 run
SEVERE: Failed to initialize Jenkins
java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:485)
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:244)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:816)
at jenkins.model.Jenkins.(Jenkins.java:730)
at hudson.model.Hudson.(Hudson.java:81)
at hudson.model.Hudson.(Hudson.java:77)
at hudson.WebAppMain$2.run(WebAppMain.java:217)
Exception in thread "pool-2-thread-1" java.lang.NullPointerException
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:191)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)


change the ajp13port to something else.....

sudo defaults write /Library/Preferences/org.jenkins-ci ajp13Port 9990

Unknown said...

Hey Steve,

Good to hear that the issue was resolved that 'easy'. Currently there is no better way for feedback, when something went wrong during the start-up. I hope you didn't spent too much time.

Unknown said...

Could you post the uninstall script, please.

I'm getting a 4040 on port 8080, and I'd just like to run this out of the box instead.

Even if I try to use Jenkins on different HTTP or ajp13 ports, it won't load, and so now I'm locked out of Jenkins completely on this machine.

Unknown said...

Hi Ted,

I'm sorry to hear that you had trouble getting everything to work properly.
First of all, you will find the uninstall script here http://dl.dropbox.com/u/318506/jenkins/uninstall.sh
I use this script, when I test the installer. Do a "sudo ./uninstall.sh" and the script removes everything except the jenkins folder in /Users/Shared/Jenkins.

I have a one questions regarding your changes:
After you changed the ajp13 port in the preferences, did you restart jenkins? I know this seems like a dumb question, but I always do a "kill -9 pid" to ensure my new settings get picked up. I had some trouble with the proper launchctl stop/start sequence.

I hope that helps to resolve your issues,
Ingo

Unknown said...

Thank, Ingo, that worked.

I don't actually want to run Jenkins as a service on this machine, and so I will just use the command line for now.

-Ted.

fritz the cat said...

Hi, thanks for the installer.

In the damon documentation you link to it says "When you install your daemon, make sure that you set the file system permissions correctly. Apple recommends that daemons be owned by root, have an owning group of wheel... " etc. Yet the workspace is owned by damon:daemon

I manualy have to change permission / owner every time I create a new job in order to put build.xml or other files into them. If I want a Jenkins job to use Ant to copy file to a dir, then I have to change that permission of that dir to 777 to make it work as user daamon is no in group staff.

This is not ideal. Any chance you could implement saner permissions? Thanks

Unknown said...

Hello fritz_the_cat,

What version of OSX are you using the installer on? I'm curious since you are the first one who reports this "misbehavior".
I'm currently on vacation with my family, but when I'm back I'd like to look into the issue and see if I can resolve this issue.

- Ingo

fritz the cat said...

thanks, no hurry, I have manually changed the group Jenkins runs under to 'staff' in the config file

I am on snow leopard

fritz the cat said...
This comment has been removed by the author.
fritz the cat said...

Actually, having problems with keys and permissions trying to manually calling svn+ssh. I have posted a question on stack overflow about it, if anybody out there knows the answer that would be great, thanks

stackoverflow.com/questions/8855631/problems-running-svnssh-from-jenkins-in-os-x-using-ssh-keys