Integrations
Jenkins
This document shows you how you can integrate Callgoose SQIBS with Jenkins.
You will be able to create incidents in Callgoose Sqibs when there is a change in the Jenkins post-build events such Build success, Build failure or any other build changes related with your Jenkins build job
In Callgoose SQIBS
Create filter as per the Jenkins build job.
- For test purpose, create an API filter like this
After test, create suitable API filter values depending on the payload sent by Jenkins to create a meaningful incident.
In Jenkins
1.Post build task plugin is required. Install Post build task plugin as admin user if it is not installed.
Go to Jenkins Dashboard, Click on Manage Jenkins then Manage Plugins Search for Post build task plugins
Select the Post build task plugin, Click on Download Now and install after restart
This will install the Post build task plugin and restart the jenkins and enable the plugin
2.Go to Jenkins Dashboard, Select the Item, Click on Dropdown and then Configure
You will see Post-build Actions. Click on Add post-build action
3.Select Post build task, Enter the Log text
-> when the build log contains the 'Log text', Jenkins 'Post build task' plugin will invoke the Callgoose Sqibs API and Callgoose Sqibs will create Incidents subjected to the API filter values. This 'Log text' is depends up on your Jenkins build jobs.
-> Example : If your Jenkins job is throwing any errors while building and these will be in the build logs. If the error contains the text 'BUILD FAILED' or 'IOException' or any other key words, you can use such 'keyword' and add it as 'Log text'. You can add multiple 'Log text' and add it as AND condition or OR condition
4.Enter the below in the Script field.
curl --location --request POST 'https://xxxxxxxx.callgoose.com/sqibs-api/v1/process?from=jenkins&token=dTsYgIyXeKz6UIAZ8qE6UKiWjIhisdkhfds09324734243290iughsfdsdze' --header 'Content-Type: application/json' --data-raw '{ "title": "WebApp build status", "content": "WebApp build failed" }'
-> How to get endpoint URL
-> Refer this link for How to send to Sqibs API
-> title and content must match with Sqibs API filter 'title' and 'content' if you have added any API filter. If the 'title' and 'content' is empty in Sqibs API filter then it will create incidents for all Sqibs API requests
-> All the values must be in Json format
5.How to test:
You can wait for real-time incident alert based on your Post build task - Log text or You can do a test by adding LOG text values in the Build Steps
Go to Jenkins Dashboard, Select the Item . Click on Dropdown and Configure and you will see Build Steps .
Click on Add build step . Choose Execute Shell add one of the LOG text value here.
Example:- echo "WebApp build failed" Click on Save
Click on Build Now to test and it will build this Jenkins job and create Sqibs incidents.
What it will do - It will generate "WebApp build failed" in the build log and 'Post build task' matches the build log with 'Log text' and it will execute the Sqibs API request to create incident. You can test each 'Log text' value like this. You can delete this build step - Execute Shell after your testing
6.Below is the incident created by Sqibs as per the Jenkins build job status
Reference