Buildkite Plugin Sources and Monorepo

We use a custom buildkite plugin for a lot of projects. We currently use ssh for downloading the plugin.

We have a desire to use a monorepo pattern, including the code required for our buildkite plugin. Would it be possible to use a git repo’s subdirectory as a plugin source?

Being able to do something like this would be ideal:

steps:
  - label: ":pipeline:"
    plugins:
      - ssh://git@github.com/org/code.git//infra/buildkite-plugin: ~

Hey @pragmakyle!

Welcome to the community! :hugs:

Yes, it’s possible; it’s what we call “vendored” plugin. You can find more info here Buildkite Agent Hooks v3 | Buildkite Documentation (and see which hooks are not available for vendored plugins). To use it, it should be something like:

steps:
  - label: ":pipeline:"
    plugins:
      - ./infra/buildkite-plugin: ~

Best!

Thanks for the reply.

We actually have all of our infra in a separate mono-repo from our infrastructure code, and we would like to keep the buildkite plugin in that repo. Would it be possible to use an repo external to the application, but still use a subdirectory of that repo?

Oh! thanks for the extra info!
Unfortunately, that it’s not possible. What I can think of that you can try, but I’m not completely sure that it may work, is using git-submodule and treating that plugin as a vendored plugin. But again, not sure that it will work…

Best!