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

Git notifyCommit doesn't trigger if the configured repository url has a user/password, but the trigger one doesn't

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Windows Server 2008 R2, SCM Manager
    • Similar Issues:

      Description

      When notifying about a repo update we use the url: http://jenkins/git/notifyCommit?url=http://repo/url

      This doesn't trigger polling for builds that have a http user/password defined in the repository url (http://user:pass@repo/url).

      Calling the trigger url with the user/password works correctly. Would be nice if they could be omitted though.

        Attachments

          Activity

          Hide
          dgajic Dragan Gajic added a comment -

          As a workaround you can use parameters when defining repository url (http://${GIT_USERNAME}:${GIT_PASSWORD}@repo/url).
          Then you can use the same url for the git hook, just you need to encode $ and {} (if you use linux/bash).

          curl http://jenkins/git/notifyCommit?url=http://\$\\{GIT_USERNAME\\}:\$\\{GIT_PASSWORD\\}@repo/url
          

          This way you will avoid to expose credentials.

          Show
          dgajic Dragan Gajic added a comment - As a workaround you can use parameters when defining repository url ( http://$ {GIT_USERNAME}:${GIT_PASSWORD}@repo/url). Then you can use the same url for the git hook, just you need to encode $ and {} (if you use linux/bash). curl http: //jenkins/git/notifyCommit?url=http://\$\\{GIT_USERNAME\\}:\$\\{GIT_PASSWORD\\}@repo/url This way you will avoid to expose credentials.
          Hide
          ndeloof Nicolas De Loof added a comment -

          git-plugin 2.0 introduce credentials support that allow you not to define URL with credentials

          Show
          ndeloof Nicolas De Loof added a comment - git-plugin 2.0 introduce credentials support that allow you not to define URL with credentials

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              miszobi Ɓukasz Pater
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: