turbot/buildkite
steampipe plugin install buildkite

Table: buildkite_pipeline - Query Buildkite Pipelines using SQL

Buildkite Pipelines are a key component of the Buildkite CI/CD platform. They define a series of steps that are executed in order to test, build, and deploy code. Each pipeline is associated with a specific code repository, and can be configured to trigger on various events, such as code commits or pull request updates.

Table Usage Guide

The buildkite_pipeline table provides detailed information about each pipeline in your Buildkite account. Developers, testers, and DevOps engineers can use this table to examine pipeline configurations, identify the steps involved in each pipeline, and analyze the status of code builds and deployments. This can be particularly useful for troubleshooting build failures, optimizing build times, and ensuring consistent deployment practices.

Examples

List pipelines

Explore the Buildkite pipelines in your system, ordered by their names, to gain insights into the different processes running in your environment. This can be useful for managing and optimizing your workflows.

select
slug,
name
from
buildkite_pipeline
order by
name;
select
slug,
name
from
buildkite_pipeline
order by
name;

Pipelines with waiting jobs

Explore which pipelines have jobs pending execution to prioritize resources and manage workflow efficiently. This allows for better allocation of resources and minimizes downtime in the pipeline.

select
slug,
name,
waiting_jobs_count
from
buildkite_pipeline
where
waiting_jobs_count > 0
order by
waiting_jobs_count desc;
select
slug,
name,
waiting_jobs_count
from
buildkite_pipeline
where
waiting_jobs_count > 0
order by
waiting_jobs_count desc;

Pipelines with the ENV VAR AWS_ACCESS_KEY_ID set

Explore which pipelines have the 'AWS_ACCESS_KEY_ID' environment variable set. This is useful to identify potential security risks or misconfigurations in your Buildkite pipelines.

select
slug,
name,
env
from
buildkite_pipeline
where
env ? 'AWS_ACCESS_KEY_ID'
Error: SQLite does not support the '?' operator for JSON objects.

Schema for buildkite_pipeline

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
archived_attimestamp with time zoneTime when the pipeline was archived.
badge_urltextBadge URL for the pipeline.
branch_configurationtextA branch filter pattern to limit which pushed branches trigger builds on this pipeline.
builds_urltextBuilds URL for the pipeline.
cancel_running_branch_buildsbooleanIf true then when a new build is created on a branch, any previous builds that are running on the same branch will be automatically canceled.
cancel_running_branch_builds_filtertextA branch filter pattern to limit which branches intermediate build cancelling applies to.
cluster_idtextID of the cluster for this pipeline.
configurationtextThe YAML pipeline that consists of the build pipeline steps.
created_attimestamp with time zoneTime when the pipeline was created.
default_branchtextThe name of the branch to prefill when new builds are created or triggered in Buildkite.
descriptiontextDescription of the pipeline.
envjsonbEnvironment variables for the pipeline.
idtextID of the pipeline.
nametextName of the pipeline.
organization_slugtext=Organization of the pipeline.
providerjsonbProvider information.
repositorytextRepository for the pipeline.
running_builds_countbigintNumber of running builds.
running_jobs_countbigintNumber of running jobs.
scheduled_builds_countbigintNumber of scheduled builds.
scheduled_jobs_countbigintNumber of scheduled jobs.
skip_queued_branch_buildsbooleanIf true then when a new build is created on a branch, any previous builds that haven't yet started on the same branch will be automatically marked as skipped.
skip_queued_branch_builds_filtertextA branch filter pattern to limit which branches intermediate build skipping applies to.
slugtext=Slug of the pipeline.
stepsjsonbBuild step definitions.
urltextURL for the pipeline.
visibilitytextVisibility of the pipeline.
waiting_jobs_countbigintNumber of waiting jobs.
web_urltextWeb URL for the pipeline.

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_pipeline