Jenkins ContinuousIntegration plugin

To run the Continuous Integration process after installing the plug-in, you must perform

one-time settings on the side of Bitbucket and Jenkins

So, let’s start, step by step


Jenkins

Make sure that following plugins are installed

Credentials plugin

Python plugin

EnvInject Plugin

Pipeline model API Plugin

Pipeline Build Step Plugin

Pipeline Stage Step Plugin

Pipeline Declarative Extension Points API Plugin


If they are not installed, then you need to install them, how to install the plugin - in detail it is described here

After successfully installing them, you need to go to Manage Jenkins => Configure System and then

  1. In the Global properties section, enable the Environmen variables checkbox and set a variable called BITBUCKET_USER and the value {NAME OF YOUR USER TO CONNECT TO BITBUCKET }
  2. In the Global Password section enable the variable called BITBUCKET_PASSWORD and having the value { NAME OF USER TO CONNECT TO BITBUCKET }

This user must have write permissions in the repository for which CI will be enabled

This user will subsequently set statuses  

SUCCESSFULLY or UNSUCCESSFULLY  depends on CI project's result


Bitbucket global settings

Install the plug-in, refresh the page and in the section Administration => Setting you will see CI settings, then click


enter the parameters, namely

Jenkins URL - URL of Jenkins from the section above

User -  the login of user Jenkins who has admin privileges

Password – the password of user Jenkins

Next, click check settings, a list of Credentials appears from which you can select the required account.

This account must have READ (or READ + WRITE) rights to the bitbucket repositories within which CI will be connected

It remains only to click “Save” to save the settings


Bitbucket repository settings

All is almost ready, you need only to enter the configuration of the project for which you need to connect CI  


Two ways CI are possible

CI based on shell command

put Checkbox - Enable CI, specify the command to start CI (by default it is “make test”) and specify the Jenkins

Executor node (or Label) of the machine where the tests will be run and click Save.

Any bitbucket project can be connected to CI by specifying only the CI command for and node (or Label) where it will be executed.

CI based on pipeline

put Checkbox - Enable CI, specify the Pipeline filename that is placed to head of default repository branch

Any bitbucket project can be connected to CI by specifying only the name of pipeline file



Now after the creation of any requester pool in the bitbucket project where the CI is connected, the testing on the specified

node and by the specified command will be automatically started(or instruction from pipeline file).  

There is no longer any need to create jenkins projects, configure many settings, you need just write / script or Makefile / to run

tests that returns exit (0) in case of success or exit(1)  in case of failure, select the executable node and specify how to run the script.

After execution of the script the status of the script is given in the pool requester

 or