Table: buildkite_build - Query Buildkite Builds using SQL
Buildkite is a continuous integration and deployment tool that integrates with version control systems to run tests on your code. It is designed to work with your existing tools and workflows, and allows you to define your build pipelines in code. Buildkite provides a platform for running fast, secure, and scalable pipelines on your own infrastructure.
Table Usage Guide
The buildkite_build
table provides insights into Builds within Buildkite. As a DevOps engineer, you can explore build-specific details through this table, including build state, number, commit, branch, and more. Utilize it to uncover information about each build, such as its current status, associated commit, and the branch it belongs to.
Examples
Builds created in the last 15 mins
Gain insights into recent activity by identifying builds that have been initiated in the last 15 minutes. This allows for immediate awareness and response to any new developments or issues.
select organization_slug, pipeline_slug, number, created_at, statefrom buildkite_buildwhere created_at > now() - interval '15 mins'order by created_at desc;
select organization_slug, pipeline_slug, number, created_at, statefrom buildkite_buildwhere created_at > datetime('now', '-15 minutes')order by created_at desc;
Builds by org
Determine the areas in which different organizations and pipelines are contributing the most by analyzing the frequency of builds. This can be useful for understanding resource allocation and identifying heavily utilized pipelines within specific organizations.
select organization_slug, pipeline_slug, count(*)from buildkite_buildgroup by organization_slug, pipeline_slugorder by count desc;
select organization_slug, pipeline_slug, count(*)from buildkite_buildgroup by organization_slug, pipeline_slugorder by count(*) desc;
Builds by day over the last week
Discover the frequency of builds started in the last two weeks. This query helps to understand the build activity patterns and could be useful for identifying peak times or days for build initiations.
select date_part('date', started_at) as hour, count(*)from buildkite_buildwhere started_at > now() - interval '14 days'group by hourorder by hour desc;
select date(started_at) as hour, count(*)from buildkite_buildwhere started_at > datetime('now', '-14 days')group by hourorder by hour desc;
Schema for buildkite_build
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
blocked | boolean | True if the build is blocked. | |
branch | text | = | Branch used for the build. |
commit | text | = | Commit used for the build. |
created_at | timestamp with time zone | >, >=, =, <, <= | Time when the build was created. |
creator | jsonb | Creator of the build. | |
env | jsonb | Environment variables used for the build. | |
finished_at | timestamp with time zone | >, >=, =, <, <= | Time when the build finished. |
id | text | ID of the build. | |
jobs | jsonb | Jobs run during the build. | |
message | text | Message for the build. | |
meta_data | jsonb | Metadata for the build. | |
number | bigint | Number of the build. | |
organization_slug | text | Organization of the build. | |
pipeline | jsonb | Pipeline the build is for. | |
pipeline_slug | text | Slug of the pipeline the build is for. | |
pull_request | jsonb | Pull request for the build. | |
scheduled_at | timestamp with time zone | Time when the build was scheduled. | |
started_at | timestamp with time zone | Time when the build was started. | |
state | text | = | State of the build. |
url | text | URL for the build. | |
web_url | text | Web URL for the build. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- buildkite
You can pass the configuration to the command with the --config
argument:
steampipe_export_buildkite --config '<your_config>' buildkite_build