Skip to content

Instantly share code, notes, and snippets.

@mipearson
Created December 11, 2018 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mipearson/e614d619e723f3344ae5e930a69d6f31 to your computer and use it in GitHub Desktop.
Save mipearson/e614d619e723f3344ae5e930a69d6f31 to your computer and use it in GitHub Desktop.
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