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

programatically add GitHub Enterprise Servers in Jenkins

    Details

    • Similar Issues:

      Description

       
      Hi,

       

      I cannot reproduce programatically this action: Manage Jenkins -> Configure System -> GitHub Enterprise Servers -> Add

      How can I do this in groovy?

      My attempt is:

      import org.jenkinsci.plugins.github_branch_source.Endpoint
      import org.jenkinsci.plugins.github_branch_source.GitHubConfiguration
      
      Endpoint endpoint = new Endpoint("http://test.com", "test")
      GitHubConfiguration ghc = new GitHubConfiguration()
      ghc.addEndpoint(endpoint)
      ghc.save()

      But it doesnt create required configuration.

       UPDATE
      in jenkins_home directory I can see file 

      org.jenkinsci.plugins.github_branch_source.GitHubConfiguration.xml with following content:

      <?xml version='1.1' encoding='UTF-8'?>
      <org.jenkinsci.plugins.github__branch__source.GitHubConfiguration plugin="github-branch-source@2.3.6">
        <endpoints>
          <org.jenkinsci.plugins.github__branch__source.Endpoint>
            <name>test</name>
            <apiUri>http://test.com</apiUri>
          </org.jenkinsci.plugins.github__branch__source.Endpoint>
        </endpoints>
      </org.jenkinsci.plugins.github__branch__source.GitHubConfiguration>

      But I still cannot see anything in Jenkins -> Manage Jenkins page.

        Attachments

          Activity

          spugachev Stanislav Pugachov created issue -
          spugachev Stanislav Pugachov made changes -
          Field Original Value New Value
          Description  
          Hi,

           

          I cannot reproduce programatically this action: Manage Jenkins -> Configure System -> GitHub Enterprise Servers -> Add

          How can I do this in groovy?

          My attempt is:
          {noformat}
          import org.jenkinsci.plugins.github_branch_source.Endpoint
          import org.jenkinsci.plugins.github_branch_source.GitHubConfiguration

          Endpoint endpoint = new Endpoint("http://test.com", "test")
          GitHubConfiguration ghc = new GitHubConfiguration()
          ghc.addEndpoint(endpoint)
          ghc.save(){noformat}
          But it doesnt create required configuration.

           
           
           Hi,

           

          I cannot reproduce programatically this action: Manage Jenkins -> Configure System -> GitHub Enterprise Servers -> Add

          How can I do this in groovy?

          My attempt is:
          {noformat}
          import org.jenkinsci.plugins.github_branch_source.Endpoint
          import org.jenkinsci.plugins.github_branch_source.GitHubConfiguration

          Endpoint endpoint = new Endpoint("http://test.com", "test")
          GitHubConfiguration ghc = new GitHubConfiguration()
          ghc.addEndpoint(endpoint)
          ghc.save(){noformat}
          But it doesnt create required configuration.

           UPDATE
           in jenkins_home directory I can see file 

          org.jenkinsci.plugins.github_branch_source.GitHubConfiguration.xml with following content:
          {noformat}
          <?xml version='1.1' encoding='UTF-8'?>
          <org.jenkinsci.plugins.github__branch__source.GitHubConfiguration plugin="github-branch-source@2.3.6">
            <endpoints>
              <org.jenkinsci.plugins.github__branch__source.Endpoint>
                <name>test</name>
                <apiUri>http://test.com&lt;/apiUri>
              </org.jenkinsci.plugins.github__branch__source.Endpoint>
            </endpoints>
          </org.jenkinsci.plugins.github__branch__source.GitHubConfiguration>{noformat}
          But I still cannot see anything in Jenkins -> Manage Jenkins page.
          spugachev Stanislav Pugachov made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              lanwen Kirill Merkushev
              Reporter:
              spugachev Stanislav Pugachov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: