turbot/buildkite
steampipe plugin install buildkite

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,
state
from
buildkite_build
where
created_at > now() - interval '15 mins'
order by
created_at desc;
select
organization_slug,
pipeline_slug,
number,
created_at,
state
from
buildkite_build
where
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_build
group by
organization_slug,
pipeline_slug
order by
count desc;
select
organization_slug,
pipeline_slug,
count(*)
from
buildkite_build
group by
organization_slug,
pipeline_slug
order 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_build
where
started_at > now() - interval '14 days'
group by
hour
order by
hour desc;
select
date(started_at) as hour,
count(*)
from
buildkite_build
where
started_at > datetime('now', '-14 days')
group by
hour
order by
hour desc;

Schema for buildkite_build

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
blockedbooleanTrue if the build is blocked.
branchtext=Branch used for the build.
committext=Commit used for the build.
created_attimestamp with time zone>, >=, =, <, <=Time when the build was created.
creatorjsonbCreator of the build.
envjsonbEnvironment variables used for the build.
finished_attimestamp with time zone>, >=, =, <, <=Time when the build finished.
idtextID of the build.
jobsjsonbJobs run during the build.
messagetextMessage for the build.
meta_datajsonbMetadata for the build.
numberbigintNumber of the build.
organization_slugtextOrganization of the build.
pipelinejsonbPipeline the build is for.
pipeline_slugtextSlug of the pipeline the build is for.
pull_requestjsonbPull request for the build.
scheduled_attimestamp with time zoneTime when the build was scheduled.
started_attimestamp with time zoneTime when the build was started.
statetext=State of the build.
urltextURL for the build.
web_urltextWeb 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