Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Grabbing a list of which Buildkite pipelines use which agent queues

Run this query via the graph explorer:

{
  organization(slug: "your-org-slug") {
    pipelines(first: 500) {
      edges {
        node {
          name
          steps {
            yaml
          }
        }
      }
    }
  }
}

Copy paste the output from the right-side pane, save as jobs.json, then run:

cat jobs.json | jq -r '
.data.organization.pipelines.edges[] | 
{ name: .node.name, yaml: .node.steps.yaml } | 
(.yaml | match("queue\\s*=\\s*([^\\s]+)")) as $regex |
[.name, $regex.captures[0].string] 
| "\(.[0])\t\(.[1])"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.