-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Jenkins ver. 2.138
Blueocean 1.8.2
GitHub Branch Source 2.3.6
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.