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, namefrom buildkite_pipelineorder by name;
select slug, namefrom buildkite_pipelineorder 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_countfrom buildkite_pipelinewhere waiting_jobs_count > 0order by waiting_jobs_count desc;
select slug, name, waiting_jobs_countfrom buildkite_pipelinewhere waiting_jobs_count > 0order 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, envfrom buildkite_pipelinewhere env ? 'AWS_ACCESS_KEY_ID'
Error: SQLite does not support the '?' operator for JSON objects.
Schema for buildkite_pipeline
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
archived_at | timestamp with time zone | Time when the pipeline was archived. | |
badge_url | text | Badge URL for the pipeline. | |
branch_configuration | text | A branch filter pattern to limit which pushed branches trigger builds on this pipeline. | |
builds_url | text | Builds URL for the pipeline. | |
cancel_running_branch_builds | boolean | If 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_filter | text | A branch filter pattern to limit which branches intermediate build cancelling applies to. | |
cluster_id | text | ID of the cluster for this pipeline. | |
configuration | text | The YAML pipeline that consists of the build pipeline steps. | |
created_at | timestamp with time zone | Time when the pipeline was created. | |
default_branch | text | The name of the branch to prefill when new builds are created or triggered in Buildkite. | |
description | text | Description of the pipeline. | |
env | jsonb | Environment variables for the pipeline. | |
id | text | ID of the pipeline. | |
member_id | text | =, !=, ~~, ~~*, !~~, !~~* | Unique identifier for the organization. |
name | text | Name of the pipeline. | |
organization_slug | text | = | Organization of the pipeline. |
provider | jsonb | Provider information. | |
repository | text | Repository for the pipeline. | |
running_builds_count | bigint | Number of running builds. | |
running_jobs_count | bigint | Number of running jobs. | |
scheduled_builds_count | bigint | Number of scheduled builds. | |
scheduled_jobs_count | bigint | Number of scheduled jobs. | |
skip_queued_branch_builds | boolean | If 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_filter | text | A branch filter pattern to limit which branches intermediate build skipping applies to. | |
slug | text | = | Slug of the pipeline. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
steps | jsonb | Build step definitions. | |
url | text | URL for the pipeline. | |
visibility | text | Visibility of the pipeline. | |
waiting_jobs_count | bigint | Number of waiting jobs. | |
web_url | text | Web 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