codependent
codependent

Reputation: 24472

How to scan repositories from a project using Bitbucket Team/Project plugin in Jenkins

My organization has a Bitbucket server organizing repositories around a team and projects:

myorg
  |--Project1
        |--RepoA
             |-Jenkinsfile
        |--RepoB
             |-Jenkinsfile
  |--Project2
        |--RepoC
             |-Jenkinsfile
        |--RepoD
             |-Jenkinsfile

When setting up a Jenkins New Item-> Bitbucket Team/Project, if I specify myorg as owner, 4 repositories are scanned and their branches appear as pipelines.

However we would like to make the scanning based on Projects (Project1, Project2), not the whole team.

Is there a way to do it? I have tried setting the owner property as:

Project1

Connecting to https://bitbucket.org using xxxx@yyyy/******

Looking up repositories of user Project1
0 repositories were processed

myorg/Project1

Connecting to https://bitbucket.org using xxxx@yyyy/******
Looking up repositories of user myorg/Project1
ERROR: [Tue Aug 14 08:42:44 UTC 2018] Could not fetch sources from navigator com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator@35b339a4
java.io.FileNotFoundException: URL: https://api.bitbucket.org/2.0/repositories/myorg%2FProject1?role=owner&page=1&pagelen=50

but none of them find any repo.

Upvotes: 4

Views: 4214

Answers (1)

Mark W
Mark W

Reputation: 5964

In the project configuration, under "Projects", "Bitbucket Team/Project" it's possible to add a behaviour "Filter by name". The value here is a regular expression

Upvotes: 0

Related Questions