turbot/buildkite
steampipe plugin install buildkite

Buildkite + Steampipe

Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.

Buildkite is a platform for running fast, secure, and scalable continuous integration pipelines on your own infrastructure.

Example query:

select
number,
state,
branch,
blocked
from
buildkite_build
where
blocked
and created_at > now() - interval '1 day';
+--------+-----------+--------+---------+
| number | state | branch | blocked |
+--------+-----------+--------+---------+
| 1 | scheduled | master | true |
+--------+-----------+--------+---------+

Documentation

Get started

Install

Download and install the latest Buildkite plugin:

steampipe plugin install buildkite

Configuration

Installing the latest buildkite plugin will create a config file (~/.steampipe/config/buildkite.spc) with a single connection named buildkite:

connection "buildkite" {
plugin = "buildkite"
token = "f7c8ce159f8e65f8f9abf0e655aa1b1afa5cef0c"
}

Environment variables are also available as an alternate configuration method:

  • BUILDKITE_TOKEN

Permissions

The token should be assigned read permissions:

  • read_agents
  • read_artifacts
  • read_build_logs
  • read_builds
  • read_job_env
  • read_organizations
  • read_pipelines
  • read_teams
  • read_user

Postgres FDW

This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- buildkite

The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.

To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.

CREATE EXTENSION IF NOT EXISTS steampipe_postgres_buildkite;
CREATE SERVER steampipe_buildkite FOREIGN DATA WRAPPER steampipe_postgres_buildkite OPTIONS (config '<your_config>');
CREATE SCHEMA buildkite;
IMPORT FOREIGN SCHEMA buildkite FROM SERVER steampipe_buildkite INTO buildkite;

SQLite Extension

This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- buildkite

The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.

To configure the SQLite extension, load the extension module and then run the steampipe_configure_buildkite function to configure it with plugin-specific options.

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_buildkite.so
sqlite> select steampipe_configure_buildkite('<your_config>');

Export

This plugin is available as a standalone Export 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>' <table_name>