Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/shp_buildrun.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ shp buildrun [flags]
* [shp buildrun cancel](shp_buildrun_cancel.md) - Cancel BuildRun
* [shp buildrun create](shp_buildrun_create.md) - Creates a BuildRun instance.
* [shp buildrun delete](shp_buildrun_delete.md) - Delete BuildRun
* [shp buildrun gather](shp_buildrun_gather.md) - Gather BuildRun diagnostics into a single directory or archive.
* [shp buildrun list](shp_buildrun_list.md) - List Builds
* [shp buildrun logs](shp_buildrun_logs.md) - See BuildRun log output

52 changes: 52 additions & 0 deletions docs/shp_buildrun_gather.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## shp buildrun gather

Gather BuildRun diagnostics into a single directory or archive.

### Synopsis


Gather collects the BuildRun object, its executor object, related execution
resources, and available container logs into a single directory.

For BuildRuns executed by a TaskRun, the command writes:

buildrun.yaml
taskrun.yaml
pod.yaml
logs/*.log

For BuildRuns executed by a PipelineRun, the command writes:

buildrun.yaml
pipelinerun.yaml
taskruns/*.yaml
pods/*.yaml
logs/<taskrun-name>/*.log

Use --archive to package the gathered files as a .tar.gz archive.


```
shp buildrun gather <name> [flags]
```

### Options

```
-z, --archive package gathered diagnostics as a .tar.gz archive
-h, --help help for gather
-o, --output string directory to write gathered files (default ".")
```

### Options inherited from parent commands

```
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
-n, --namespace string If present, the namespace scope for this CLI request
--request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
```

### SEE ALSO

* [shp buildrun](shp_buildrun.md) - Manage BuildRuns

2 changes: 1 addition & 1 deletion pkg/shp/cmd/build/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func TestStartBuildRunFollowLog(t *testing.T) {
pm.Timeout = &tests[i].to
}
failureDuration := 1 * time.Millisecond
param := params.NewParamsForTest(kclientset, shpclientset, pm, metav1.NamespaceDefault, &failureDuration, &failureDuration)
param := params.NewParamsForTest(kclientset, shpclientset, nil, pm, metav1.NamespaceDefault, &failureDuration, &failureDuration)

ioStreams, _, out, _ := genericclioptions.NewTestIOStreams()

Expand Down
1 change: 1 addition & 0 deletions pkg/shp/cmd/buildrun/buildrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func Command(p *params.Params, ioStreams *genericclioptions.IOStreams) *cobra.Co
runner.NewRunner(p, ioStreams, createCmd()).Cmd(),
runner.NewRunner(p, ioStreams, cancelCmd()).Cmd(),
runner.NewRunner(p, ioStreams, deleteCmd()).Cmd(),
runner.NewRunner(p, ioStreams, gatherCmd()).Cmd(),
)
return command
}
2 changes: 1 addition & 1 deletion pkg/shp/cmd/buildrun/cancel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func TestCancelBuildRun(t *testing.T) {
if _, err := cmd.Cmd().ExecuteC(); err != nil {
t.Error(err.Error())
}
param := params.NewParamsForTest(nil, clientset, nil, metav1.NamespaceDefault, nil, nil)
param := params.NewParamsForTest(nil, clientset, nil, nil, metav1.NamespaceDefault, nil, nil)

ioStreams, _, _, _ := genericclioptions.NewTestIOStreams()
err := cmd.Run(param, &ioStreams)
Expand Down
Loading
Loading