hasura / smooth-checkout-buildkite-plugin

All the things you need during a Buildkite checkout :butter: :kite:
Apache License 2.0
14 stars 12 forks source link

Make the checkout directory configurable #25

Closed GMNGeoffrey closed 2 years ago

GMNGeoffrey commented 2 years ago

This changes the plugin to use BUILDKITE_BUILD_CHECKOUT_PATH by default with the ability to specify another path. When only one repo is checked out, it is checked out directly at the checkout path, as in the Buildkite default checkout behavior. When multiple repos are checked out, they are each in their own subdirectory under BUILDKITE_BUILD_CHECKOUT_PATH with names determined by their URL.

I made use of this in my own project with https://github.com/google/iree/pull/8619

Fixes https://github.com/hasura/smooth-checkout-buildkite-plugin/issues/13 Fixes https://github.com/hasura/smooth-checkout-buildkite-plugin/issues/21 Fixes https://github.com/hasura/smooth-checkout-buildkite-plugin/issues/22 Fixes https://github.com/hasura/smooth-checkout-buildkite-plugin/issues/23

GMNGeoffrey commented 2 years ago

@scriptnull PTAL @imperfect-fourth does this address your use case for #23 also?

scriptnull commented 2 years ago

@GMNGeoffrey Thanks for the pull request! We will read through this and get back :slightly_smiling_face:

imperfect-fourth commented 2 years ago

the working directory for single repo checkout is different

Ah my bad, it seems the behaviour is same

GMNGeoffrey commented 2 years ago

I think that the first one can be avoided by keeping both the env vars for now and maybe marking WORKSPACE as deprecated. What do you think?

Sure, that makes sense to me

GMNGeoffrey commented 2 years ago

Sorry I was out on vacation for a while. I've updated to still set the WORKSPACE variable. Note that this still isn't backward compatible because it defaults to buildkite's default checkout path instead of the custom path that was hardcoded before. I don't see a clean way to preserve backward compatibility here.

GMNGeoffrey commented 2 years ago

Ping on this?

imperfect-fourth commented 2 years ago

@GMNGeoffrey sorry for the delay. A new release have been made(v4.0.0) with your changes. Thank you for the contribution!