feedback icon indicating copy to clipboard operation
feedback copied to clipboard

Ability to specify root directory

Open elliot opened this issue 8 years ago • 3 comments

We have a couple of projects that are mono-repo's. Each sub project is contained in a folder but it makes command steps and hooks a bit harder to use.

It would be great to be able to specify a root directory to change into at the start of a build as well as the ability to have folder level hooks.

I.e.

project/
  ui/                 - root
    .buildkite/
  api/                - root
    .buildkite/hooks/pre-command

elliot avatar May 10 '17 03:05 elliot

Hi @elliot, I think you can already do this by adding a post-checkout hook which changes the $BUILDKITE_BUILD_CHECKOUT_PATH to a subdirectory (export BUILDKITE_BUILD_CHECKOUT_PATH="$BUILDKITE_BUILD_CHECKOUT_PATH/ui"). Local hooks are resolved from the current working (so ui/.buildkite/hooks/pre-command would be run). Does something like that work?

sj26 avatar Jul 04 '17 08:07 sj26

You can see how this works in the beta agent here:

https://github.com/buildkite/agent/blob/5a591236b5e1a35ea97ceeb038797c761b7f0346/bootstrap/bootstrap.go#L1077-L1098

sj26 avatar Jul 04 '17 08:07 sj26

What about if you wanted to have different pipelines from the same repo? In your example, it looks like the ui subfolder would always be selected.

mr-rodgers avatar Jul 25 '18 12:07 mr-rodgers