Sets the Buildkite git flags for the current build. This can be useful to customize the behavior of the git commands used by Buildkite.
Add the following to your pipeline.yml
(all flags are optional and update the corresponding flags in your pipeline:
steps:
- command: ls
plugins:
- whizzzkid/git-flags#<latest_tag>:
clean_flags: "-ffxdq"
clone_flags: "--depth=1"
clone_mirror_flags: "--mirror"
fetch_flags: "--depth=1"
mirrors_lock_timeout: 100
mirrors_path: "~/new/path"
mirrors_skip_update: "false"
If you're using buildkite-builder
, then you can introduce the plugin like:
Buildkite::Builder.pipeline do
# ...
# other setups
# ...
plugin :shallow_clone, 'ssh://[email protected]/whizzzkid/git-flags-buildkite-plugin.git#<latest-tag>', {
clone_flags: '--single-branch --depth 1',
fetch_flags: '--depth 1'
}
# then int the command step
command do
label 'Do Something'
# ... command config
plugin :shallow_clone
end
end
Note
Don't forget to replace <latest-tag>
with a corresponding tag from the releases.
Git clean flags, e.g. "-ffxdq". Supports any pattern supported by git-clean. Corresponding Buildkite documentation can be found here.
Git clone flags, e.g --depth=1
. Supports any pattern supported by git clone. Corresponding Buildkite documentation can be found here
Git fetch flags, e.g --all
. Supports any pattern supported by git fetch. Corresponding Buildkite documentation can be found here
Buildkite clone mirror flags, e.g --mirror
. Corresponding Buildkite documentation can be found here
Buildkite mirror lock timeout, e.g 100
, default 300
. Corresponding Buildkite documentation can be found here
Buildkite mirrors path, e.g ~/new/path
. Corresponding Buildkite documentation can be found here
Buildkite skip mirrors update, e.g true
. Corresponding Buildkite documentation can be found here.
To run the tests:
docker-compose run --rm tests
- Fork the repo
- Make the changes
- Run the tests
- Commit and push your changes
- Send a pull request