CI/CD Clean-up jobs for self-hosted workers

Hey folks

I'm looking for a path to running a clean-up step in Space CI/CD. Something that always runs after the explicit and implicit job steps that gives a chance to do some custom clean-up.

Our build uses bazel which by default writes outputs outside of the space job directories (described here). If a bazel builder does nothing it'll slowly fill up the worker disk.

A fix would be to invoke bazel specifying the output directory under JB_SPACE_STEP_DATA_PATH, so the bazel outputs get cleaned up when the CI/CD job finishes. There's a bug in bazel which makes overriding the output directory a bit of a chore. We're going down the chore path, but it would be simpler if there was a way to add a clean-up step.

Thanks in advance

 

0

Please sign in to leave a comment.