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

Bitbucket plugin is not triggering the job(s) when ssh and https have different hostnames

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • bitbucket-plugin
    • None
    • Jenkins-2.176.3
      Bitbucket Plugin 1.1.11 (latest)
      Bitbucket Server 5.8.2

      Bitbucket is not triggering matching jobs.

      The log statements in Jenkins are showing this after pushing to ci-test.git Repo:

      ...
      Considering candidate job xx-freestyle-triggered-by-bitbucket
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering to poke xx-freestyle-triggered-by-bitbucket
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProberepo scheme: ssh
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeTrying to match ssh://git@git.mygroup.net:7999/scopecom/ci-test.git<-->https://atc.mygroup.net/scopecom/ci-test 
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbexx-freestyle-triggered-by-bitbucket SCM doesnt match remote repo {1}
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering candidate job xx-pipeline-triggered-by-bitbucket
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering to poke xx-pipeline-triggered-by-bitbucket
      ...
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProberepo scheme: ssh
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeTrying to match ssh://git@git.mygroup.net:7999/scopecom/ci-test.git<-->https://atc.mygroup.net/scopecom/ci-test 
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbexx-pipeline-triggered-by-bitbucket SCM doesnt match remote repo {1}
      ...

      I´ve already merged https://github.com/jenkinsci/bitbucket-plugin/pull/59 - but I still have an issue caused by different hostnames.

      In our setup we have

      The final check is comparing the hostname(s) - and the project/repo paths.

      I dont know why the Bitbucket team decided for different hostnames for the same thing - but I need an "official" solution to be able to use this plugin.
      One idea could be to add some global configuration, where hostname equivilents may be defined (in a map for example)
      So I would add there
      git.mygroup.net == atc.mygroup.net
      Another idea would be to add a checkbox like "ignore hostname, compare project/repo only".

      The plugin should consider this alternatives - and perform the comparison accordingly.

            tzach_solomon Tzach Solomon
            torstenreinhard Torsten Reinhard
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: