Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-54702

Discover Bitbucket repo when receiving first webhook event

XMLWordPrintable

      I'm trying to get to a setup where I don't have to scan in Jenkins to discover repo's every time I create a new repository. With GitHub, this is solved by having a Team webhook instead of a webhook per repo.

      With Bitbucket, the repo's are managed using Terraform, so I can precreate the Jenkins webhook like this:

      resource "bitbucket_repository" "example_repo" {
        owner       = "myteam"
        name        = "example"
        slug        = "example"
        has_issues  = false
        has_wiki    = false
      }
      
      resource "bitbucket_hook" "jenkins" {
        owner       = "${bitbucket_repository.example_repo.owner}"
        repository  = "${bitbucket_repository.example_repo.slug}"
        url         = "https://jenkins.example.com/bitbucket-scmsource-hook/notify"
        description = "Jenkins hook"
      
        events = [
          "repo:push",
          "pullrequest:created",
          "pullrequest:updated",
          "pullrequest:fulfilled",
          "pullrequest:rejected",
        ]
      } 

      Doing this, I assumed that a previously unknown repo would start building when Jenkins receives the first webhook, however this does not seem to be the case.

      It would be nice if Jenkins would 'discover' the new repository when receiving the first webhook event associated with that new repo.

            Unassigned Unassigned
            simonwydooghe Simon Wydooghe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: