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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BUILDKITE_GIT_CLEAN_FLAGS #270

Merged
merged 2 commits into from Mar 17, 2016
Merged

Add BUILDKITE_GIT_CLEAN_FLAGS #270

merged 2 commits into from Mar 17, 2016

Conversation

toolmantim
Copy link
Contributor

馃殌 #240

The default git clean flags are -fdq. It's useful to be able to configure this. For example, -x can be used to remove gitignore'd files. Or -e can be used to exclude specific directories.

Introduce an environment variable BUILDKITE_GIT_CLEAN_FLAGS to control this behavior. This can then be set in an environment hook.

grosskur and others added 2 commits March 17, 2016 17:08
The default `git clean` flags are `-fdq`. It's useful to be able to
configure this. For example, `-x` can be used to remove gitignore'd
files. Or `-e` can be used to exclude specific directories.

Introduce an environment variable `BUILDKITE_GIT_CLEAN_FLAGS` to
control this behavior. This can then be set in an `environment` hook.

Closes #173
toolmantim added a commit that referenced this pull request Mar 17, 2016
@toolmantim toolmantim merged commit 0cc483f into master Mar 17, 2016
@toolmantim toolmantim deleted the git-clean-flags branch March 17, 2016 06:14
@toolmantim
Copy link
Contributor Author

I just tested it with the following environment hook, and it works a treat:

#!/bin/bash

set -eu

export BUILDKITE_GIT_CLEAN_FLAGS="-fdx"

And in the build output:

$ git clean "-fdx"
Removing .env
Removing buildkite-script-8c8a6870-349c-4af7-a5c7-49b79f2f67fc

.env was a git ignored file 馃憤

@grosskur
Copy link
Contributor

Nice, thanks for merging! 馃憤

@toolmantim
Copy link
Contributor Author

Do you all think we should remove the -q by default? It's all under the "Preparing build header" and I think it might help people know what's going on. If you want it to be quiet you can now change it too, but I'd assume most people would want to see more clearly what's getting cleaned.

@keithpitt
Copy link
Member

I think @sj26 made something else not quiet recently?

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.

None yet

3 participants