Sync Jenkins data to SQL Server on schedule
Recipe ToolsDeveloper ToolDatabase
What it does
When a specified interval occurs, this automation retrieves JSON data from Jenkins using a custom operation. The JSON response is then inserted as a batch of rows into SQL Server so the database stays current.
Who it's for
Engineering teams who need Jenkins data synced to SQL Server on a regular schedule without manual intervention.
How teams use this
Sync build metrics to a data warehouse
Run the Jenkins custom operation every hour to pull build status and performance data, then batch insert into SQL Server for reporting and analysis. The team sees fresh metrics without manual exports.
Archive Jenkins logs to SQL Server
Trigger the sync daily to extract Jenkins logs as JSON and store them in SQL Server for long-term retention and compliance. The schedule ensures no data is missed between runs.
Filter JSON before inserting to database
Add a condition after the Jenkins step to check the JSON response and only insert rows that meet specific criteria, such as failed builds or builds over a certain duration. This keeps the table focused on actionable data.
How it works
- Wait for the scheduled interval. At the scheduled time, this automation wakes up and begins retrieving data from Jenkins to sync with SQL Server.
- Retrieve JSON from Jenkins. Run a custom operation in Jenkins to fetch JSON data. The response is formatted and prepared for the database insert into SQL Server.
- Insert batch into SQL Server. Insert the batch of rows into the dbo.myTest table in SQL Server so the data is stored and available for queries and reporting.