Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
News ticker list
displayTime5000
color#46A7DE
width100%
titleOther powerful plugins from Mohami

...

  1. Setting the JVM switches -Dhudson.model.ParametersAction.keepUndefinedParameters=true and -Dhudson.plugins.git.GitStatus.allowNotifyCommitParameters=trueThis will allow arbitrary notify commit parameters (reference). Only enable this if you trust all unauthenticated users to not pass harmful arguments to your jobs.

  2. Setting the JVM switch -Dhudson.plugins.git.GitStatus.safeParameters=PARM1,PARM1. If this property is set to a comma separated list of parameters, then those parameters will be allowed for any job. Only set this value for parameters you trust in all the jobs in your system.

For detailed instructions on adding Java arguments to Jenkins, see CloudBees guide here

Usage

Bitbucket Server

  1. Go to your hook settings, then go to Webhook to Bitbucket for Jenkins → Advanced Configuration → URL Parameters → Parameters.

  2. Enter the URL parameter into the parameter box. The rules for the parameters are as follows:

    1. The formatting for the url parameter is DESIRED_VARIABLE_NAME={PARAMETER_NAME}. 

    2. Every parameter must start on a new line

    3. Name your parameter whatever you'd like, this is how you're going to reference the parameter in Jenkins. In our example we're going to name the parameter e.g. TARGET_BRANCH.

    4. To pull information from Bitbucket to use as a parameter (like the branch name), look at the table below and put it on the right side of the equal sign and surround it with curly braces, e.g. {BRANCH}

    5. If you want to put your own custom value, just eliminate the curly braces and put the value at the right side of the equal sign.

...

Note

Please note, that you cannot use additional parameters together with Omit SHA1 Hash Code option enabled with Git endpoint - this case is not supported on Jenkins side, see details here.

Jenkins

To be able to access the parameter in your Jenkins job do the following:

...