Jenkins
Integrating Jenkins with Hivel allows you to gain data-driven insights into your development workflow. Follow these steps to set up the integration correctly.
System Requirements
Before proceeding, ensure the following: ✅ You have Admin access to Jenkins. (Preferably, a DevOps engineer should handle this)
Check if the below plugins are installed on Jenkins. If not, install them.
Plugin Name
Description
Link
Status
HTTP Request Plugin
Enables making HTTP requests within Jenkins pipelines.
Need to install
Timestamper Plugin
Adds timestamps to Jenkins build logs for better debugging.
Need to install
Pipeline (Workflow Aggregator)
Provides the essential pipeline functionality in Jenkins.
Mostly Already installed
Git Plugin
Enables Jenkins to fetch and manage source code from Git repositories.
Mostly Already installed
Credentials Binding Plugin
Allows securely storing and using credentials in Jenkins pipelines.
Mostly Already installed
Groovy Plugin
Allows running Groovy scripts within Jenkins.
Mostly Already installed
How to Install These Plugins:
Go to Manage Jenkins → Manage Plugins → Available Plugins.
Search for the plugins listed above and install them.
Restart Jenkins after installation (if prompted).
Required Credentials for Integration
During the integration, you'll need:
Organization ID (Generated in the Hivel application)
API Key (Generated in the Hivel application)
Retrieving Your Organization ID and API Key
Open the Hivel application and navigate to Integrations under the Settings.
Locate the Jenkins Integration card and click Connect.
Follow the given steps to start your integration.
By clicking on generate your Organization ID and API Key will be generated.
Use these fields while integrating with Jenkins. The steps for where to apply them are provided on the following page.
If you find it difficult, don’t worry! You can always reach out to us for assistance at support@hivel.ai.
Configuring Credentials in Jenkins
Log in to your Jenkins application.
From the side navigation, select Manage Jenkins.
Click on Credentials.
Click on global under Stores scoped to Jenkins
Choose Add Credentials - you will need to do this twice (once for the Organization ID and once for the API Key).
From the dropdown, select Secret text.
After selecting Secret text from the dropdown, fill in the details twice as follows:
Adding the API Key
ID: hivel-jenkins-api-key
Secret: {your API key} (copied from Hivel)
Description: This is the Jenkins API key from Hivel
Click Save
Repeat the process again for Adding the Organization ID
ID: hivel-org-id
Secret: {your Organization ID} (copied from Hivel)
Description: This is the Jenkins Organization ID from Hivel
Click Save
Once you have completed the above steps, your Jenkins Global Credentials should display the following entries:
Changes to pipeline script
Go to Dashboard
Select any pipeline->Configure->Edit Pipeline
In the pipeline script, add the following:
And this to your pipeline initialization code:
How to Wrap Your Stage Code for Metrics Collection
For each additional stage you add, ensure you wrap your existing commands with the following snippet. This wrapping captures the start time, end time, duration, and status of the stage:
Insert your stage commands where indicated.
This snippet ensures that each stage’s metrics are captured and included in the final payload sent to Hivel.
API call from Jenkins
Add the below code after each stage:
Once the code wrapping is done, your code will look similar to the sample script in the next tab.
Once the changes are done, click on Apply -> Save.
Repeat the steps for each stage of your pipeline script. Please check the indentation while wrapping the code.
Run the build once changes are made to all the stages.
These are the details we will be receiving from Jenkins upon successful integration:
The integration is considered complete once the build is run, successfully processed, and the integration card updates to "Connected".
If you need any support at any point, please feel free to reach out to us at support@hivel.ai. We’re happy to assist you!
Last updated
Was this helpful?