On Tuesday, March 6, 2012 12:22:09 PM UTC+1, Jerome Lacoste wrote:
>
> Today I upgraded jenkins on the command line using:
>
>     sudo installer -pkg jenkins-1.454.pkg -target /
>
> This changed the permissions of the Jenkins home directory. I had to fix 
> them using:
>
>     chown -R jenkins:daemon /Users/Shared/Jenkins/
>
> Is that a bug ? If not, what is the proper procedure to remotely upgrade 
> jenkins on Mac OS X and not loose setup ?
>

OK got it. I am new to Mac OS X. My assumption was that the installer 
command would upgrade the package keeping its original option 
configurations. It doesn't

One has to specify the proper option from the command line using 
the applyChoiceChangesXML argument.

I haven't yet tested the following but it should work. I am waiting for the 
release that will contain the change I just committed (support of permGen 
option): 
https://github.com/jenkinsci/jenkins/commit/fb9f0679c7c75ea1e6c85bbe4f663896714bf63e

To list the option one has by default in the package one does something 
like that

     sudo installer -showChoiceChangesXML -pkg jenkins-1.454.pkg  -target /

which prints out an XML preferences. I stored it 
under jenkins_CLI_install_orig.plist. (omitting the -target / option fails 
with a strange error on my machine  "installer: Cannot install on volume 
(null) because it is disabled.")

and then one can copy that file and edit it to contain the options one 
want. In my case:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<array>
        <dict>
                <key>attributeSetting</key>
                <integer>1</integer>
                <key>choiceAttribute</key>
                <string>selected</string>
                <key>choiceIdentifier</key>
                <string>jenkinslaunchdjenkins</string>
        </dict>
        <dict>
                <key>attributeSetting</key>
                <integer>0</integer>
                <key>choiceAttribute</key>
                <string>selected</string>
                <key>choiceIdentifier</key>
                <string>jenkinslaunchd</string>
        </dict>
</array>
</plist>

To test the new config:

    sudo installer -showChoicesAfterApplyingChangesXML 
jenkins_CLI_install_override.plist -pkg jenkins-1.454.pkg  -target / > 
jenkins_CLI_install_new.plist

# diff  -u jenkins_CLI_install_orig.plist jenkins_CLI_install_new.plist 
--- jenkins_CLI_install_orig.plist 2012-03-07 08:04:30.000000000 +0100
+++ jenkins_CLI_install_new.plist 2012-03-07 08:21:15.000000000 +0100
@@ -44,7 +44,7 @@
  </dict>
  <dict>
  <key>attributeSetting</key>
- <integer>1</integer>
+ <integer>0</integer>
  <key>choiceAttribute</key>
  <string>selected</string>
  <key>choiceIdentifier</key>
@@ -68,7 +68,7 @@
  </dict>
  <dict>
  <key>attributeSetting</key>
- <integer>0</integer>
+ <integer>1</integer>
  <key>choiceAttribute</key>
  <string>selected</string>
  <key>choiceIdentifier</key>


and to finally run the command (untested)

    sudo installer 
-applyChoiceChangesXML jenkins_CLI_install_override.plist -pkg 
 jenkins-1.454.pkg  -target /

When tested, I will update the Wiki.

Jerome


Reply via email to