Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5723

Allow setting arbitrary command line arguments when defining a mercurial executable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: mercurial-plugin
    • Labels:
      None
    • Environment:
      Hudson ver. 1.342, hg version 1.4.1, Mercurial plugin 1.25
    • Similar Issues:

      Description

      I'd like to pass an arbitrary set of --config aa.bb="ccc ddd" options to mercurial when it clones (or updates) certain remote repositories. In my case, this is to configure ssh to use a particular private key when doing an automated build.

      Putting options in the mercurial executable field does not seem to work (can't find executable error).

        Attachments

          Issue Links

            Activity

            laurie_int laurie_int created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Assignee kohsuke [ kohsuke ] jglick [ jglick ]
            Hide
            jglick Jesse Glick added a comment -

            Would be useful to permit this field to be treated as a complete command-line prefix. Of course there are workarounds:

            1. Set up ~/.hgrc on the Hudson server.

            2. Make a custom shell script which passes your extra params plus normal arguments ('hg --config s.k=v "$@"' for Bourne shell), and pass that as the Hg executable.

            Show
            jglick Jesse Glick added a comment - Would be useful to permit this field to be treated as a complete command-line prefix. Of course there are workarounds: 1. Set up ~/.hgrc on the Hudson server. 2. Make a custom shell script which passes your extra params plus normal arguments ('hg --config s.k=v "$@"' for Bourne shell), and pass that as the Hg executable.
            Hide
            laurie_int laurie_int added a comment -

            In my case, I have this situation:

            • running as me interactively, I want to use a passworded ssh private key configured to allow pushing to remote. (So option 1 is no good.)
            • running as me in hudson, I want to use a non-passworded ssh private key that only allows pulling.

            The second workaround would allow this. The main disadvantage is yet another step to set up a development machine.

            Show
            laurie_int laurie_int added a comment - In my case, I have this situation: running as me interactively, I want to use a passworded ssh private key configured to allow pushing to remote. (So option 1 is no good.) running as me in hudson, I want to use a non-passworded ssh private key that only allows pulling. The second workaround would allow this. The main disadvantage is yet another step to set up a development machine.
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-19719 [ JENKINS-19719 ]
            Hide
            jglick Jesse Glick added a comment -

            By the way the original request is now better handled by the Credentials plugin integration. So now treating this as a variant option to JENKINS-19719.

            Show
            jglick Jesse Glick added a comment - By the way the original request is now better handled by the Credentials plugin integration. So now treating this as a variant option to JENKINS-19719 .
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-17632 [ JENKINS-17632 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Hide
            jglick Jesse Glick added a comment -

            Developing a feature allowing .hgrc-like configuration to be specified as part of a Mercurial installation definition.

            Might also be useful to allow such configuration to be specified for a particular job, which would be useful so that job configurers without overall administrative permission could turn on or off compression and so on, but this would be a bit more work so I am not doing it right now.

            Show
            jglick Jesse Glick added a comment - Developing a feature allowing .hgrc -like configuration to be specified as part of a Mercurial installation definition. Might also be useful to allow such configuration to be specified for a particular job, which would be useful so that job configurers without overall administrative permission could turn on or off compression and so on, but this would be a bit more work so I am not doing it right now.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/hudson/plugins/mercurial/HgExe.java
            src/main/java/hudson/plugins/mercurial/MercurialInstallation.java
            src/main/resources/hudson/plugins/mercurial/MercurialInstallation/config.jelly
            src/main/resources/hudson/plugins/mercurial/MercurialInstallation/help-config.html
            src/test/java/hudson/plugins/mercurial/CustomConfigTest.java
            src/test/java/hudson/plugins/mercurial/HgExeFunctionalTest.java
            http://jenkins-ci.org/commit/mercurial-plugin/c777dc9cbef3abbb0da25fdca9bcfa14622d77e2
            Log:
            [FIXED JENKINS-5723] Permit arbitrary --config options to be defined for a given Mercurial installation.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/hudson/plugins/mercurial/HgExe.java src/main/java/hudson/plugins/mercurial/MercurialInstallation.java src/main/resources/hudson/plugins/mercurial/MercurialInstallation/config.jelly src/main/resources/hudson/plugins/mercurial/MercurialInstallation/help-config.html src/test/java/hudson/plugins/mercurial/CustomConfigTest.java src/test/java/hudson/plugins/mercurial/HgExeFunctionalTest.java http://jenkins-ci.org/commit/mercurial-plugin/c777dc9cbef3abbb0da25fdca9bcfa14622d77e2 Log: [FIXED JENKINS-5723] Permit arbitrary --config options to be defined for a given Mercurial installation.
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 135815 ] JNJira + In-Review [ 187050 ]

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                laurie_int laurie_int
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: