Table: circleci_context - Query CircleCI Contexts using SQL
CircleCI Contexts is a feature within CircleCI that allows you to create and manage contexts. Contexts are used to share environment variables across multiple projects. These environment variables are encrypted and stored securely, allowing you to manage access to sensitive information within your pipelines.
Table Usage Guide
The circleci_context
table provides insights into contexts within CircleCI. As a DevOps engineer, explore context-specific details through this table, including names, IDs, and creation timestamps. Utilize it to uncover information about contexts, such as their associated environment variables, the projects they are shared with, and the management of access to sensitive data.
Examples
Contexts across my organizations
Explore the various contexts within your organizations to understand when they were created and their correlation with specific organization slugs. This can help in managing and organizing your resources more efficiently.
select id, name, organization_slug, created_atfrom circleci_context;
select id, name, organization_slug, created_atfrom circleci_context;
Context environment variables of an organization
Discover the environment variables within a specific organization's context to understand when they were created or last updated. This can help in maintaining the organization's configuration and track any changes made over time.
select c.name as context, v.context_id, v.variable, v.created_at, v.updated_atfrom circleci_context c join circleci_context_environment_variable v on v.context_id = c.idwhere organization_slug = 'gh/fluent-cattle';
select c.name as context, v.context_id, v.variable, v.created_at, v.updated_atfrom circleci_context c join circleci_context_environment_variable v on v.context_id = c.idwhere organization_slug = 'gh/fluent-cattle';
Schema for circleci_context
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
created_at | timestamp with time zone | Timestamp of when context was created. | |
id | text | Unique key for the context. | |
login_id | text | =, !=, ~~, ~~*, !~~, !~~* | Unique identifier for the account login. |
name | text | The context name. | |
organization_slug | text | A unique identification for the organization in the form of: <vcs_type>/<org_name>. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. |
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_context