ParameterizedBuilds / parameterized-builds

Other
31 stars 27 forks source link

:warning: Notice of Deprecation: Parameterized Builds for Jenkins is now deprecated. No new feature development will be done and users are encouraged to seek other alternatives to trigger their Jenkins jobs.

Welcome to the Jenkins Parameterized Build Plug-in

Build Status

Setup

  1. Define a server
  2. Define a job
  3. Link your bitbucket server account to Jenkins

Define a server

Jenkins servers can be defined globally on the Administration page of Bitbucket Server or per project on the project settings page.

Jenkins administration settings

Define a job

Jenkins hook settings
Jenkins hook settings
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.

Link your bitbucket server account to Jenkins

Jenkins user settings
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.

Triggers

Triggers

You can use any combination of triggers.

Build Parameters

branch=$BRANCH  
environment=dev;test;prod
boolean=true

Build parameters can be specified using key=value pairs.
You can use predefined variables that will be replaced when the build is triggered. For example branch=$BRANCH will replace $BRANCH with the branch name that triggered the build.
Built-in variables:

Parameter Types:

Multibranch Pipeline Setup

Jenkins Multibranch pipelines can be built directly or through scans. Therefore, if the Multibranch Pipeline checkbox is selected, REF CREATED, REF DELETED, and PUSH EVENT triggers will cause a scan while all others will trigger a build for the given branch. Triggers still need to be selected like any other job.

Contributing