Smart Mirrors currently only works with the Git Plugin.

Smart Mirrors helps when Bitbucket Server is used by distributed teams which are working with large repositories. It allows you to use local mirror instance for git operations which greatly increased performance for your organization.

Webhook to Jenkins can also be configured to use this mirror (as it requires clones for each build).


If Smart mirror is configured correctly Bitbucket shows the following option when providing a clone URL:

You will need to choose your mirror, and use the Clone URL to configure your Jenkins job. This step assumes you are using Git Plugin as Bitbucket Branch Source plugin won't work with mirror (as it provides support for basic git operation only)

Next step is select mirror server in hook settings:

Mirror server dropdown doesn't appear if no mirrors are configured.

Selecting a mirror changes plugin behavior when it ignores all regular events but triggers jenkins only when selected mirror is synchronized with primary server. Clone url is changing accordingly to the mirror selected.

If it's required to revert to regular behavior "Primary" option needs to selected.