Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass working dir between hooks #577

Merged
merged 4 commits into from
Nov 9, 2017
Merged

Conversation

lox
Copy link
Contributor

@lox lox commented Nov 8, 2017

It's common in v2 agent hooks to change directories and expect it to affect subsequent hooks, for instance you might want to change the working directory in a pre-command hook for a monorepo.

This PR makes that happen.

@lox lox requested a review from keithpitt November 9, 2017 00:06
Copy link
Member

@keithpitt keithpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah nice! This must have been a regression in the great bootstrap rewrite of 2017?

@lox
Copy link
Contributor Author

lox commented Nov 9, 2017

Nope, it was never implemented in v3.

@lox
Copy link
Contributor Author

lox commented Nov 9, 2017

I don't think, anyway.

@lox lox merged commit dfd21dc into master Nov 9, 2017
@lox lox deleted the pass-working-dir-between-hooks branch November 9, 2017 09:56
@lox
Copy link
Contributor Author

lox commented Nov 11, 2017

I think I figured out how we thought this worked @keithpitt. The example you mentioned of agent-tests uses a post-checkout hook and sets BUILDKITE_BUILD_CHECKOUT_PATH:

https://github.com/buildkite/agent-tests/blob/60dff36cffd83ed3b8b389b475359b7b4484f53e/.buildkite/hooks/post-checkout.bat#L6

There is special handling in the v3 bootstrap for this changing in post-checkout hooks. The v2 bootstrap will respect any directory change in a hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants