• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • p4-plugin
    • None

      For the Github plugin, there is a "Build when a change is pushed to GitHub" option (https://wiki.jenkins-ci.org/display/JENKINS/Github+Plugin) as well as for CVS a "post commit trigger" howto. (https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-UsingapostcommittriggerinCVS)

      An option for the perforce plugin would be nice.
      A build trigger... Something like "Build when a change is pushed to depot"

          [JENKINS-25249] Post-commit hook for P4 plugin

          swolk created issue -
          swolk made changes -
          Component/s New: p4 [ 19224 ]
          Component/s Original: plugin-proposals [ 15491 ]
          Component/s Original: perforce-plugin [ 15506 ]
          swolk made changes -
          Labels Original: build jenkins plugin
          swolk made changes -
          Link New: This issue is related to JENKINS-12101 [ JENKINS-12101 ]

          swolk added a comment -

          Would be great to trigger builds from perforce instead of having to poll. Current url trigger mechanism in Jenkins is not realistic because you would need to create new perforce trigger for every job.

          swolk added a comment - Would be great to trigger builds from perforce instead of having to poll. Current url trigger mechanism in Jenkins is not realistic because you would need to create new perforce trigger for every job.

          Paul Allen added a comment -

          [1] I guess you need a single entry point where the change-number is passed in. Then the P4 plugin could then work out which Jenkins job or jobs to trigger?

          or ...

          [2] A subscribe model, A bit like the old p4 review/reviews command, but for Jenkins jobs to subscribe to Perforce depot paths.

          Paul Allen added a comment - [1] I guess you need a single entry point where the change-number is passed in. Then the P4 plugin could then work out which Jenkins job or jobs to trigger? or ... [2] A subscribe model, A bit like the old p4 review/reviews command, but for Jenkins jobs to subscribe to Perforce depot paths.
          Paul Allen made changes -
          Assignee New: Paul Allen [ p4paul ]

          David Pärsson added a comment - - edited

          Design 1 is similar to what the Subversion plugin does. To use this with Subversion, the Subversion server is configured with a post-commit hook that makes a request to Jenkins over HTTP. One significant difference from your design is that the request also includes the changed paths as POST data, removing the need for Jenkins to ask the Subversion server for changes. See the Subversion plugin's wiki page for more details.

          David Pärsson added a comment - - edited Design 1 is similar to what the Subversion plugin does. To use this with Subversion, the Subversion server is configured with a post-commit hook that makes a request to Jenkins over HTTP. One significant difference from your design is that the request also includes the changed paths as POST data, removing the need for Jenkins to ask the Subversion server for changes. See the Subversion plugin's wiki page for more details.

          Paul Allen added a comment -

          I like the POST data idea for change-list details. I may combine [1] and [2], using a web service for Jenkins to subscribe to and then use Perforce triggers to poke the web service.

          [Perforce]                [Web Service]               [Jenkins]
               |                          |                         |
               |                          | <-----(subscribe)------ |
               |                          |                         |
               | ----(change-commit)---> [ ]                        |
               |                         [ ] ----(POST change)---> [ ] 
          

          Paul Allen added a comment - I like the POST data idea for change-list details. I may combine [1] and [2] , using a web service for Jenkins to subscribe to and then use Perforce triggers to poke the web service. [Perforce] [Web Service] [Jenkins] | | | | | <-----(subscribe)------ | | | | | ----(change-commit)---> [ ] | | [ ] ----(POST change)---> [ ]

          Would this be a standalone web service, needing to be hosted outside Jenkins and Perforce? I'm no expert in the inner workings of Perforce so this might be the best solution, but requiring a third piece of software to be hosted is a drawback to me.

          David Pärsson added a comment - Would this be a standalone web service, needing to be hosted outside Jenkins and Perforce? I'm no expert in the inner workings of Perforce so this might be the best solution, but requiring a third piece of software to be hosted is a drawback to me.

            p4paul Paul Allen
            swolk swolk
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: