From e3f3d061e1fb6740e5fc9e8a4ee07cca4b255211 Mon Sep 17 00:00:00 2001 From: Terence Kwan Date: Mon, 29 Mar 2021 12:13:06 -0700 Subject: [PATCH] add hook --- hooks/pre-checkout | 11 +++++++++++ plugin.yml | 9 +++++++++ 2 files changed, 20 insertions(+) create mode 100755 hooks/pre-checkout create mode 100644 plugin.yml diff --git a/hooks/pre-checkout b/hooks/pre-checkout new file mode 100755 index 0000000..01db2b6 --- /dev/null +++ b/hooks/pre-checkout @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "Running git-shallow-clone-buildkite-plugin -- pre-checkout" + +DEPTH="${BUILDKITE_PLUGIN_GIT_SHALLOW_CLONE_DEPTH:-1}" +export BUILDKITE_GIT_CLONE_FLAGS="-v --depth ${DEPTH}" +#export BUILDKITE_GIT_FETCH_FLAGS="-v --prune --depth ${DEPTH}" + +#export BUILDKITE_GIT_CLONE_FLAGS="-v --filter=blob:none" diff --git a/plugin.yml b/plugin.yml new file mode 100644 index 0000000..6bd88da --- /dev/null +++ b/plugin.yml @@ -0,0 +1,9 @@ +name: Git shallow clone +description: Sets git-clone and git-fetch flags to perform a shallow clone +author: https://github.com/vgrigoruk +requirements: ['git'] +configuration: + properties: + depth: + type: number + additionalProperties: false