Created on 01-22-202606:53 AM - edited on 01-22-202607:22 AM by VidyaSargur
Apache NiFi 2.X or CFM Version 4.X now provide an ability to use Bitbucket as flow version control in place of NiFi Registry.
This new Registry Client is built with the name BitbucketFlowRegistryClient to connect to Bitbucket
To set up BitbucketFlowRegistryClient following information is required from the Bitbucket account as a prerequisite; if not present must be created
Workspace Name
Repository Name
Authentication Type
Default Branch
Repository Path
For this article Authentication Type is set to Access Token. This user needs to make sure the Access token is generated and kept handy from the Repository settings page in Bitbucket. Also, the user needs to make sure the Repository permissions are set up properly with Read and Write access on the Repository
BitbucketFlowRegistryClient also needs StandardWebClientServiceProvider in the very first place as a Web Client Service to create an HTTP web client to connect to the Bitbucket API
Once StandardWebClientServiceProvider is created and enabled from the Management Controller Services. From the Registry Client, add BitbucketFlowRegistryClient and configure.
StandardWebClientServiceProvider and other property values as captured from Bitbucket as a prerequisite, and apply and enable the BitbucketFlowRegistryClient
After this, go and create a Process Group in NiFi if it has not been created before or if there are Process Groups created and a flow built inside, just right-click on the Process Group and click on Version with Start Version Control.
This action will open the Save flow version page, where the user can provide the Flow Name, Flow Description, and Version Comments, and save it
Upon Successful Versioning, the Process Group should have the right check mark icon in Green Colour at the top left corner.
And, the following entry should be updated in the BitBucket UI
Once the flow is published to BitBucket UI, and if there are further changes in the flow inside the Versioned process group, then the process group version icon will change from the right check to the gear icon, with Version menu items now showing (Commit/Show/Revert local changes /Stop version Control).
Upon Commit Local Changes, the user will be prompted to add comments regarding the new version.
Upon successful save, the BitBucket UI should show updated Version details:
At this point, the flows can be deployed into NiFi from BitBucket through version control. To do this use click on the Import from Registry icon in the NiFi UI
Import from the Registry window should show all the versions of the flow that were published in earlier steps into BitBucket. Select the desired version and import the from Into NiFi from BitBucket.
Note: Apache NiFi 2.7.2 version is used to prepare the snapshots, few properties may vary between Apache NiFi 2.X vs CFM 4.X, but all the required ones are there.