Skip to content

Commit d33ab45

Browse files
authored
Merge pull request #20 from buildkite-plugins/SUP-5032/Add-verbose
Add verbose logging option
2 parents ae82e9b + 95cff5e commit d33ab45

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@ Whether to skip ssh-keyscan step. This will skip adding each ssh public key into
2626

2727
#### `clean_checkout` ('true' or 'false')
2828

29-
Whether to perform aggressive repository cleanup before checkout. This option handles scenarios where interrupted or cancelled jobs leave the git repository in a corrupted state with uncommitted changes that would prevent checkout. When enabled, it performs `git reset --hard HEAD` and `git sparse-checkout disable` in addition to the normal cleanup.
29+
Whether to perform aggressive repository cleanup before checkout. This option handles scenarios where interrupted or cancelled jobs leave the git repository in a corrupted state with uncommitted changes that would prevent checkout. When enabled, it performs `git reset --hard HEAD` and `git sparse-checkout disable` in addition to the normal cleanup.
3030

3131
**⚠️ Warning:** This option will destroy ALL local changes and remove ALL untracked files. The `git clean -ffxdq` command with the `-x` flag will also remove ignored files (such as credentials, local configuration, or cache files). Only use this option when you're certain no important local data needs to be preserved.
3232

3333
Use this option for pipeline upload jobs that don't need to preserve local changes.
3434

35+
#### `verbose` ('true' or 'false')
36+
37+
Enable verbose logging with bash execution tracing (`set -x`). This shows each command being executed and can help debug issues with ssh-keyscan, git operations, or other checkout problems. When enabled, you'll see detailed output including command arguments and any error messages from underlying tools.
38+
3539
## Example
3640

3741
Below is an example of using sparse-checkout plugin.
@@ -41,7 +45,7 @@ steps:
4145
- label: "Pipeline upload"
4246
command: "buildkite-agent pipeline upload"
4347
plugins:
44-
- sparse-checkout#v1.1.0:
48+
- sparse-checkout#v1.2.0:
4549
paths:
4650
- .buildkite
4751
```
@@ -55,7 +59,7 @@ steps:
5559
- label: "Pipeline upload with clean checkout"
5660
command: "buildkite-agent pipeline upload"
5761
plugins:
58-
- sparse-checkout#v1.1.0:
62+
- sparse-checkout#v1.2.0:
5963
paths:
6064
- .buildkite
6165
clean_checkout: true

hooks/checkout

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
77
# shellcheck source=lib/plugin.bash
88
. "$DIR/../lib/plugin.bash"
99

10+
VERBOSE_OPTION="$(plugin_read_config VERBOSE "false")"
11+
[[ "${VERBOSE_OPTION}" = "true" ]] && set -x
12+
1013
NO_CONE_OPTION="$(plugin_read_config NO_CONE "false")"
1114
NO_CONE_PARAM=""
1215
[[ $NO_CONE_OPTION = false ]] || NO_CONE_PARAM="--no-cone"

plugin.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ configuration:
1616
clean_checkout:
1717
type: boolean
1818
default: false
19+
verbose:
20+
type: boolean
21+
default: false
1922
required:
2023
- paths
2124
additionalProperties: false

0 commit comments

Comments
 (0)