Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Jenkins integration turns Bitbucket base url from https to http

ThomasK March 1, 2024

In the Jenkins plugin the Bitbucket base URL is specified with  HTTPS as  https://bitbucket.myco.com and the verification test works fine. However, in the pipeline job, Jenkins is trying to checkout the code as http://bitbucket.myco.com/scm/PROJECT/REPO.git. In our env, http access is not forwarded to https so the checkout is blocked.

It's very frustrating as the plugin seems to make up the url wrong even though the Bitbucket server url is specified as  https://bitbucket.myco.com in the Jenkins system configuration pertains to the plugin, and it seems to be some simple config issue. Cannot figure out if the issue is on the Jenkins side or on the Bitbucket side (probably the API might be returning wrong url to the plugin). Any ideas on how to force Jenkins to use the specified base url?

1 answer

1 vote
ThomasK March 4, 2024

Checked the output of this endpoint later and realized that the API is returning "http" urls: GET /rest/api/1.0/projects/PROJECTKEY/repos/REPONAME

So this is no fault of Jenkins plugin :-)

How to resolve this on the Bitbucket side? The base url is https, and API doesn't honor that. There is an AWS ALB in front of this service the https is terminated at the LB level, and the root cause could be that. Any ideas on how to force the API to generate https urls?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events