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

Support default checkout directory #2

Closed scriptnull closed 3 years ago

scriptnull commented 3 years ago

Currently, all the checkouts happen in $HOME/builds/<HOSTNAME>/<PIPELINE_SLUG>

This will be problematic when trying to run builds parallelly on the same machine.

So for every build, we will first create a unique directory where our script will operate. (mkdir -p and cd into this directory at the top of our checkout script)

This unique directory will be of the format $HOME/buildkite-checkouts/$BUILDKITE_BUILD_ID/$BUILDKITE_JOB_ID (check if the envs mentioned in the format are accessibly correctly in the script. If not we could modify the format

We should also clean up the checkout directory in the pre-exit hook.