Warm tip: This article is reproduced from serverfault.com, please click

Jenkins could NOT discover Bitbucket Repositories

发布于 2020-11-23 09:41:44

My company recently moved the source control into Bitbucket.org. The commercial plan.

How we use:

  • Our developer team still using the company email id(like name1@myCompany.com) to login to https://bitbucket.org for operating, but a web redirect to a company grant privilege's page is always needed.
  • all repos are grouped under a logical group(say myCompany), I don't how to say it, the workspace?? anyway, the summary page for list all available repos are: https://bitbucket.org/myCompany/
  • All repos are private and file: Jenkinsfile is contained.

We have setup a standard Jenkins server(version 2.249.3) in a cloud, with plugIn: bitbucket 1.1.27, I created a build job item: Bitbucket Team/Project, input the credential with type Username and password, of course the username is: name1@myCompany.com, and this user has been granted 'admin', the Owner I input the myCompany.

my config

after ran this job, the overall connection seems fine, but never scanned any repos, the jenkins job logs:

Started [Mon Nov 23 13:05:31 CST 2020] Starting organization scan... [Mon Nov 23 13:05:31 CST 2020] Updating actions... Looking up team details of myCompany... Connecting to https://bitbucket.org using name1@myCompany.com/****** (fffff) Could not resolve team details [Mon Nov 23 13:05:33 CST 2020] Consulting Bitbucket Team/Project Connecting to https://bitbucket.org using name1@myCompany.com/****** (fffff) Looking up repositories of user myCompany 0 repositories were processed [Mon Nov 23 13:05:33 CST 2020] Finished organization scan. Scan took 2.1 sec Finished: SUCCESS

any idea???

Questioner
Shawn
Viewed
0
Shawn 2020-12-02 17:40:59

I have copied the answer which resolved the problem from their site:

Based on the info you gave us here, I believe you'll need to look into the following 3 things:

  1. For HTTPS authentication, you will need to use the Bitbucket username of the account you are authenticating with, instead of the email. The email is needed for logging in to the website (https://bitbucket.org/) only.

If this is your Bitbucket Cloud account, you can find the username in the following page after you log in:

https://bitbucket.org/account/settings/ 2. Since your company has managed accounts (the company domain has been verified), you will also need to use an app-password for authentication instead of a password.

You can find instructions on how to generate an app-password for the Bitbucket Cloud account you use for authentication here:

https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/ 3. I see in your screenshot a field Owner, below the credentials. What is the description of this field? What are the instructions on what to fill in there?

I suggest double checking what is expected in this field, but I believe that you may need to fill in the workspace ID of the workspace that owns the repos your team is working on.

Have you replaced 'myCompany' with the actual workspace ID? Because the log you gave us here mentions 'myCompany'. The workspace ID should indeed be the part of the URL after https://bitbucket.org/ , in the URL where the repos can be found https://bitbucket.org/myCompany