Jenkinsとgitbucketの連携

Asked 1 years ago, Updated 1 years ago, 135 views

I tried to link Jenkins and Gitbucket with the following information, but it didn't work.
The situation is as follows, but do you have any information such as the combination of versions and configuration points that are working well?

Jenkins' GitBucket+Jenkins collaboration is this easy with Jenkinsfile and GitHub Organization Folder plug-in

When I register the API endpoint for GitHub Enterprise Servers with Jenkins configuration, I get an error message similar to the following:

This URL requires POST
The URL you're trying to access requirements that requests be sent using POST (like a form submission). The button below allow you to try access this URL using POST. URL being accessed:
 http://jenkins.jenkins_default:8080/descriptorByName/org.jenkinsci.plugins.github_branch_source.Endpoint/checkApiUri?value = http%3A%2F%2Fgitbucket.jenkins_default%2Fapi%2Fv3%2FpFup;2Fup%A%2Fup;2Fup%Ack%;2Fup%A%A%Ack%2Fup;http%2Fup%Fup;http=http

If you were sent here from an untrusted source, please proceed with cushion.

The jenkins server to the gitbucket server was accessible via GET at http://gitbucket.jenkins_default/api/v3/, but POST was caused by 404

:

bash-4.4# curl-X GET http://172.18.0.2/api/v3/
{"rate_limit_url": "http://gitbucket.jenkins_default/api/v3/rate_limit"}
bash-4.4# curl-X POST http://172.18.0.2/api/v3/
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing/api/v3/.Reason:
<pre>Not Found</pre>/p>
</body>
</html>
bash-4.4# 

The Jenkins version is 2.121.2
The Gitbucket version is 4.26.0

That's it

git jenkins gitbucket

2022-09-30 19:28

1 Answers

The error occurred because line 145 of the code below required POST for the affected source.

145@RequirePOST
146@Restricted (NoExternalUse.class)
147 publicFormValidation doCheckApiUri(@QueryParameterStringapiUri){

In Jenkins' configuration screen, entering the URL of Gitbucket results in ERROR, but if you save the configuration, create a Multibranch pipeline job, select GitHug in Branch Source, select a server registered from API Endpoint, and enter the Gitbucket username in Owner, as shown in the screenshot below, you can ignore the Gitbucket repository.

Configuring Multibranch pipeline jobs


2022-09-30 19:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.