-
Notifications
You must be signed in to change notification settings - Fork 29
Initial Setup
Jenkins servers can be defined globally on the Administration page of Bitbucket Server or per project on the project settings page.

-
Base URLshould be the http/https root address to you jenkins server -
Default UserandDefault Tokenare optional and used as a fall back authentication for triggering jobs - Build Token Root Plugin uses an alternate alternate address for triggering builds anonymously
- enable this only if you have this plugin installed in Jenkins


Enable Parameterized Builds for Jenkins under the hooks settings for a repository.
You can add as many jobs as you want (within reason),
they will be triggered in the order they are added.
-
Job Nameis the job to build -
Ref Typewill apply your triggers to either branch operations or tag operations -
Multibranch Pipelineshould only be used to trigger jenkins multibranch pipelines -
Triggersspecifies when to trigger a build -
Tokencorrespondes to the authorization token on your job configuration page in Jenkins Build Parameters-
Ref Filteruses java regex syntax to only trigger a build for branches/tags that match the filter- the filter will only be used for branch/tag creation, branch pushes, and branch/tag deletion
- leave blank to match all branches
-
Monitored Pathswill only trigger a build if a file in the diff matches the filter- the filter will only be used for branch pushes and PR events
- leave blank to match all changes
-
Required Build Permissionwill restrict who can trigger a Jenkins job using the repository permissions- This is only available on manual triggers
-
PR Destination Filterfunctions identically toRef Filterbut on the branch being merged into

On your user account page you can add your Jenkins API token.
When added bitbucket server will use your Jenkins account
to trigger jobs for branches you create/push, pull requests you open, or for manual builds.
If you have multiple Jenkins servers setup you can set the api token for each one.
Order of authentication:
The Jenkins user Token from the Jenkins User Settings will be used for authentation first.
If that is not set then the Token parameter in the job configuration will be used second.
If that is not set then the Default User and Default Token on the Jenkins
server settings page will be used.