stisti / jenkins-app

Make Jenkins behave like a Mac application to make it easier to manage.
246 stars 20 forks source link

Not easy to change JENKINS_HOME location #19

Closed kelan closed 11 years ago

kelan commented 11 years ago

I don't like having the whole Jenkins workspace dir be hidden (in a dot dir), so I prefer to set JENKINS_HOME to something like ~/jenkins. I used to do this by setting that environment variable before running the command to start Jenkins, as I don't think there is a options flags argument for this. Unfortunately, it doesn't seem like there is a good way to set an environment variable like this currently with jenkins-app.

I edited the script to add a jenkins_home property (next to the jenkins_url one), and then put that in the "env" section of the do shell script call to launchctl to start Jenkins, and it works for me. But, if this is something that others would find useful, perhaps it should be another option during the manual configuration setup prompts? Or at least supported in the prefs file?

stisti commented 11 years ago

Right. I was under the impression JENKINS_HOME could be changed using a command line option but apparently that is not the case. I'm sure we can work out something.

stisti commented 11 years ago

I expected to be able to give you a workaround right away but I found it didn't work. Normally, the open command passes its environment to the app it launches. Like

JENKINS_HOME=$HOME/jenkins open /Applications/Jenkins.app

But this time it does not work because Jenkins.app calls launchctl to actually run the jvm and launchd sanitizes the environment.

stisti commented 11 years ago

But you could do it like this:

launchctl setenv JENKINS_HOME $HOME/jenkins

and then start Jenkins.app. This should help you while I think what to do with it. I have to also sort out some other distribution location for the Jenkins.app builds because Github no longer provides the file download service.

kelan commented 11 years ago

launchctl setenv JENKINS_HOME $HOME/jenkins

Oh, interesting. I didn't know about that.

Anyway, as I said, I already manually tweaked the script to do what I needed, so, I'm fine for now. But I was just wondering if this is an option that other people might find useful as well…

stisti commented 11 years ago

I decided to not make a new dialog about this. I think setting JENKINS_HOME is an acceptable solution. It is now documented in the README: ed50f6de60203655b7e4bba04f419fdcd5e66e44