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

How to let jenkins clone and use the branch I hope?

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • git-plugin
    • None
    • Centos

      Hi,

      The jenkins I am using is Jenkins ver. 2.60.1,  I just want to trigger the new created jenkins job to let jenkins clone the project branch(which contains Jenkinsfile) I want, how to do it?

      The command I use is:

       curl -X POST "http://localhost:8080/job/order-center-bis-dx/buildWithParameters" --user "$username:$password" --data-binary "tag_branch:CI" -H "$CRUMB”(tag_branch is I added in configuration as Git Parameter)

      But I think the --data-binary I used was incorrect, I also tried with --data-binary "branch:CI" or "ref:CI", each time I failed, looks like jenkins clone one branch randomly.  

      I didn't find the info I want from "/job/order-center-bis-dx/api/" nor https://wiki.jenkins.io/display/jenkins/remote+access+api  

      I want some advices, anybody can help?

      Thanks

            kohsuke Kohsuke Kawaguchi
            melissa Lee Melissa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: