Table: circleci_pipeline - Query CircleCI Pipelines using SQL
CircleCI is a continuous integration and delivery platform that automates the build, test, and deploy processes for software applications. The Pipeline is a key feature of CircleCI, representing an individual instance of a run workflow, including its status, triggers, and associated metadata. It provides developers with a detailed view of their application's build process, enabling them to quickly identify and resolve issues.
Table Usage Guide
The circleci_pipeline
table provides insights into each pipeline run within CircleCI. As a developer or DevOps engineer, explore pipeline-specific details through this table, including status, triggers, and associated metadata. Utilize it to monitor your application's build process, identify bottlenecks or failures, and optimize your continuous integration and delivery workflows.
Important Notes
- You must specify
project_slug
in thewhere
clause to query this table.
Examples
Error details of the pipelines of a project
Discover the segments that contain errors within a specific project's pipelines. This can be useful in quickly identifying and addressing issues to improve project performance and efficiency.
select id, number, errorsfrom circleci_pipelinewhere project_slug = 'gh/fluent-cattle/sp-plugin-test' and errors is not null and jsonb_array_length(errors) > 0;
select id, number, errorsfrom circleci_pipelinewhere project_slug = 'gh/fluent-cattle/sp-plugin-test' and errors is not null and json_array_length(errors) > 0;
Number of pipelines per project
Analyze the settings to understand the distribution of pipelines across various projects. This can help in identifying projects with heavy pipeline utilization, aiding in resource allocation and optimization.
select pr.slug, count(pl.*)from circleci_project pr join circleci_pipeline pl on pr.slug = pl.project_sluggroup by pr.slug;
select pr.slug, count(pl.project_slug)from circleci_project pr join circleci_pipeline pl on pr.slug = pl.project_sluggroup by pr.slug;
Pipelines of a project by state
Explore the distribution of pipeline states within a specific project. This can help in identifying patterns or issues related to the project's pipeline states.
select state, count(*)from circleci_pipelinewhere project_slug = 'gh/fluent-cattle/sp-plugin-test'group by state;
select state, count(*)from circleci_pipelinewhere project_slug = 'gh/fluent-cattle/sp-plugin-test'group by state;
Schema for circleci_pipeline
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
created_at | timestamp with time zone | Timestamp of when the pipeline was created. | |
errors | jsonb | A list of errors while executing pipeline's jobs. | |
id | text | Unique key for the pipeline. | |
login_id | text | =, !=, ~~, ~~*, !~~, !~~* | Unique identifier for the account login. |
number | bigint | A second identifier for the pipeline. | |
project_slug | text | = | A unique identification for the project in the form of: <vcs_type>/<org_name>/<repo_name>. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state | text | The state of the pipeline. | |
trigger | jsonb | What triggers the pipeline to run. | |
trigger_parameters | jsonb | Any parameter for pipeline triggering. | |
updated_at | timestamp with time zone | Timestamp of when pipeline was updated. | |
vcs | jsonb | Version control system of 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)" -- circleci
You can pass the configuration to the command with the --config
argument:
steampipe_export_circleci --config '<your_config>' circleci_pipeline