Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Fixed
-
Component/s: blueocean-plugin, github-plugin
-
Labels:None
-
Environment:Jenkins ver. 2.138
Blueocean 1.8.2
GitHub Branch Source 2.3.6
-
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
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</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. |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
I managed to do it:
I don't know if it is a proper way to do this, but anyway