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

Unable to use the same buildWithParameter variable webhook across different repositories

XMLWordPrintable

      I have a single job parameterized to accept a single parameter 'git_repo'. The goal is for a single job to be triggered remotely using a github webhook and pass a unique value for git_repo which matches the source repo which triggered the build.

      The build then substitutes the git_repo variable throughout the job during various build/post build phases (used for checking out code : https://github.com/${git_repo}.git) This works for a single repo,the problem is when I try to use this same webhook  in a different repo.

      Steps to reproduce: 

      Create freestyle job using 'this build is parameterized' with a string parameter called git_repo with no default value or description. 

      Set the job trigger as trigger builds remotely (e.g., from scripts).

      Setup the job to Delete the workspace before the build, and for Source Code Management, add additional repo behaviors :  clean before checkout,  wipeout repo and force clone  and clean after checkout are all set (these were attempts to solve this issue but none of these have worked)

      In github setup webhook for RepoA : 

      https://myjenkins.com/buildByToken/buildWithParameters?job=jenkinsjobname&token=tokenvalue&git_repo=RepoA

      Fire the webhook and see jenkins successfully take parameter and check out the git repo URL with the substituted parameter.

      In Github setup webhook for RepoB:

      https://myjenkins.com/buildByToken/buildWithParameters?job=jenkinsjobname&token=tokenvalue&git_repo=RepoB

      Trigger the webhook to test it's connection to jenkins and see the stack trace and 500 http response : 

      Caused by: java.lang.IllegalArgumentException: Illegal number of parameter values for repository: 2

      Full stack trace is attached.

      Job template is attached.

       

       

       

       

            huybrechts huybrechts
            mshate123 heather noe
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: