[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Boguslaw Klimas resolved as Fixed Release 0.9.10 Jenkins / JENKINS-54062 Does not list branches when used as a parameter in pipeline script Change By: Boguslaw Klimas Status: Reopened Resolved Resolution: Fixed Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Boguslaw Klimas commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script This issue should be resolve in release 0.9.10 Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script Boguslaw Klimas I figured it out! Ok, so if your build fails for any reason the first time you run it (which happened for me in my pipeline script), Jenkins will then become "parameter aware" and will create the Git parameter for you. After this, you are screwed. The only way around it is to edit the job, explicitly remove the parameter from the top of the job definition (i.e. not from the Pipeline script itself, but rather from the "This project is Parameterized" area. Then you can run it again as if it were your first time running the job, wait for it to finish, and then go back and "Build with Parameters" and the Git parameter will correctly show the branches, instead of the error message. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script Damn. I just tried this again on my own project... same problem. The only way to get around it is to comment out the "branch" in the git command. I'll put together a demo and paste the required logs. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script Boguslaw Klimas I think everything is good. I didn't have the same problems when re-testing. However, I did find that if I used the g...@github.com/klimas7 urls in the checkout I'd get a "Permission Denied (public key)" error. I had to test using the https repo urls. Thanks for your help. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn updated an issue Jenkins / JENKINS-54062 Does not list branches when used as a parameter in pipeline script Change By: Craig Tataryn Attachment: image-2018-11-08-16-47-55-704.png Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Boguslaw Klimas commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script Hmm, it's strange Could you attache logs form initial builds? Was initial build finished as success? (using my script, without commenting) Could you look (or attache) in jenkins log? Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script For me, I copy/pasted your script to a new Pipeline job. I ran it initially and it showed me the error in the select box. I went to build it again and it still showed me that error. I had to comment out the “branch” parameter, run it again (observe the error) and then re-enable the branch parameter and then the next time I built it correctly showed my branches. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Boguslaw Klimas commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script Script which I added should work fine, without any change. You don't need comment anything because first run (initial run) get default value (master) from gitParameter definition. I create job 'MultiSCM_pipeline_v4' using your steps from previous comment. I have the same version Jenkins and Git Parameter Initial build logs Started by user administrator Running in Durability level: MAX_SURVIVABILITY [Pipeline] node Running on Jenkins in /opt/tools/jenkins_2_89_4/workspace/MultiSCM_pipeline_v4 [Pipeline] { [Pipeline] stage [Pipeline] { (Example) [Pipeline] git Cloning the remote Git repository Cloning repository g...@github.com:klimas7/exampleA > git init /opt/tools/jenkins_2_89_4/workspace/MultiSCM_pipeline_v4 # timeout=10 Fetching upstream changes from g...@github.com:klimas7/exampleA > git --version # timeout=10 > git fetch --tags --progress g...@github.com:klimas7/exampleA +refs/heads/*:refs/remotes/origin/* > git config remote.origin.url g...@github.com:klimas7/exampleA # timeout=10 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 > git config remote.origin.url g...@github.com:klimas7/exampleA # timeout=10 Fetching upstream changes from g...@github.com:klimas7/exampleA > git fetch --tags --progress g...@github.com:klimas7/exampleA +refs/heads/*:refs/remotes/origin/* > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision c2483c12bba0a7ac904c1b26750020388f294188 (refs/remotes/origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f c2483c12bba0a7ac904c1b26750020388f294188 > git branch -a -v --no-abbrev # timeout=10 > git checkout -b master c2483c12bba0a7ac904c1b26750020388f294188 Commit message: "Initial commit" First time build. Skipping changelog. [Pipeline] git > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url g...@github.com:klimas7/exampleB # timeout=10 Fetching upstream changes from g...@github.com:klimas7/exampleB > git --version # timeout=10 > git fetch --tags --progress g...@github.com:klimas7/exampleB +refs/heads/*:refs/remotes/origin/* > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision 742a796edf874e4ef2714363da2e41cefbfcc5ed (refs/remotes/origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f 742a796edf874e4ef2714363da2e41cefbfcc5ed > git branch -a -v --no-abbrev # timeout=10 > git branch -D master # timeout=10 > git checkout -b master 742a796edf874e4ef2714363da2e41cefbfcc5ed Commit message: "Initial commit" First time build. Skipping changelog. [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: SUCCESS
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Boguslaw Klimas updated an issue Jenkins / JENKINS-54062 Does not list branches when used as a parameter in pipeline script Change By: Boguslaw Klimas Attachment: image-2018-10-14-00-07-36-349.png Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script Boguslaw Klimas So... I figured this one out. I had to run the pipeline script once through without specifying a branch, so essentially I had to run like this: pipeline { agent any parameters { gitParameter branchFilter: 'origin.*/(.*)', defaultValue: 'master', name: 'BRANCH_A', type: 'PT_BRANCH', useRepository: '.*exampleA' gitParameter branchFilter: 'origin.*/(.*)', defaultValue: 'master', name: 'BRANCH_B', type: 'PT_BRANCH', useRepository: '.*exampleB' } stages { stage('Example') { steps { git /* commented out -> branch: "${params.BRANCH_A}",*/ url: 'g...@github.com:klimas7/exampleA' git /* commented out -> branch: "${params.BRANCH_B}",*/ url: 'g...@github.com:klimas7/exampleB' } } } } Only after that initial run could I go back in, re-add the branch info to the git steps, and then "Build with Parameters" would then fetch the branches for the Git Parameters section. Is this the intended means in which to run the plugin within a pipeline script? Or is there an easier way? (i.e. less manual intervention) Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn reopened an issue Please see my updated comments Jenkins / JENKINS-54062 Does not list branches when used as a parameter in pipeline script Change By: Craig Tataryn Resolution: Not A Defect Status: Closed Reopened Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script Boguslaw Klimas infact I just tried your script above like so in Jenkins: New Item Pipeline Configuring the new job, I placed your script in the Pipeline area of the job I ran the job once so the parameters would be picked up by the gui I then clicked "Build with Parameters" and observed that the Git Parameter boxes state "!No Git repository configured in SCM configuration" I'm running Jenkins 2.138.2, and Git Parameter Plugin 0.9.6 Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script I should mention, in the job itself I don't have a "SCM" configuration section setup in the job's gui. This is strictly a pipeline script job. In fact I cannot setup a pipeline script that has a SCM section like I would have in the past with a free-style project. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script Boguslaw Klimas Thanks for the quick response! I see what you mean, I changed the regex and got rid of the `.git` on the end. Unfortunately I get the same result. Were you actually able to get your script to run properly? Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Boguslaw Klimas closed an issue as Not A Defect Configuration issue Jenkins / JENKINS-54062 Does not list branches when used as a parameter in pipeline script Change By: Boguslaw Klimas Status: Open Closed Resolution: Not A Defect Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Boguslaw Klimas commented on JENKINS-54062 Re: Does not list branches when used as a parameter in pipeline script Hi, On wiki is write: 'This option is a regular _expression_, which is compared to the 'Repository URL'.' In your pipeline useRepository option isn't match on any url. '.*crowd.git' not match on 'g...@githost.org:crowd/crowd' and '.*crowd-ember.git' not match on 'g...@githost.org:crowd/crowd-ember' You must remove '.git' from useRepository option or add '.git' to git url Please look on this pipeline pipeline { agent any parameters { gitParameter branchFilter: 'origin.*/(.*)', defaultValue: 'master', name: 'BRANCH_A', type: 'PT_BRANCH', useRepository: '.*exampleA' gitParameter branchFilter: 'origin.*/(.*)', defaultValue: 'master', name: 'BRANCH_B', type: 'PT_BRANCH', useRepository: '.*exampleB' } stages { stage('Example') { steps { git branch: "${params.BRANCH_A}", url: 'g...@github.com:klimas7/exampleA' git branch: "${params.BRANCH_B}", url: 'g...@github.com:klimas7/exampleB' } } } } Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-iss
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn updated an issue Jenkins / JENKINS-54062 Does not list branches when used as a parameter in pipeline script Change By: Craig Tataryn Priority: Minor Blocker Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54062) Does not list branches when used as a parameter in pipeline script
Title: Message Title Craig Tataryn created an issue Jenkins / JENKINS-54062 Does not list branches when used as a parameter in pipeline script Issue Type: Bug Assignee: Boguslaw Klimas Attachments: image-2018-10-13-14-04-44-440.png Components: git-parameter-plugin Created: 2018-10-13 19:09 Priority: Minor Reporter: Craig Tataryn I noticed that the git-parameter-plugin now supports pipeline scripts, however I can not get the plugin to pickup branches for my repository. For instance, I setup my pipeline script according to the documentation: pipeline { agent any parameters { gitParameter branchFilter: 'origin.*/(.*)', defaultValue: 'master', name: 'BRANCH_A', type: 'PT_BRANCH', useRepository: '.*crowd.git' gitParameter branchFilter: 'origin.*/(.*)', defaultValue: 'master', name: 'BRANCH_B', type: 'PT_BRANCH', useRepository: '.*crowd-ember.git' } stages { stage('Git Checkouts') { steps { git branch: "${params.BRANCH_A}", credentialsId: 'e9e6e6f8-4c03-4460-ac4f-f2495315ef11', url: 'g...@githost.org:crowd/crowd' git branch: "${params.BRANCH_B}", credentialsId: 'e9e6e6f8-4c03-4460-ac4f-f2495315ef11', url: 'g...@githost.org:crowd/crowd-ember' } } } } The job has been setup as a "Pipeline" type and the script above is what I placed in its "Pipleline Script" section. And yet, when I run my pipeline script I only see: Not entirely sure what I'm doing wrong here