From 75bae8dc124a237d034700590e447f90274e0b15 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Tue, 2 Aug 2022 13:00:44 -0400 Subject: [PATCH 1/2] Add clone retries documentation Tested on our pipelines Implemented in https://github.com/drone/drone-git/pull/43 + https://github.com/drone-runners/drone-runner-docker/pull/44 + https://github.com/drone/runner-go/pull/22 --- .../pipeline/docker/syntax/cloning/_index.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/content/pipeline/docker/syntax/cloning/_index.md b/content/pipeline/docker/syntax/cloning/_index.md index d56ce59b9..2620b1806 100644 --- a/content/pipeline/docker/syntax/cloning/_index.md +++ b/content/pipeline/docker/syntax/cloning/_index.md @@ -78,6 +78,27 @@ steps: - go test {{< / highlight >}} +# retries + +By default, the clone step will fail if any of the git commands fail. This can be altered by setting a number of retries. When this is set, the failing command will be rerun the given number of times, and the step will only be marked as failure if none of the tries are successful. For example: + + +{{< highlight text "linenos=table,hl_lines=5-6" >}} +kind: pipeline +type: docker +name: default + +clone: + retries: 3 + +steps: +- name: build + image: golang + commands: + - go build + - go test +{{< / highlight >}} + # Custom Logic The default clone behavior can be disabled and custom clone logic implemented, when necessary. In the following example we implement custom clone commands as a pipeline step: From 25aa013a5466c5c13183dc5943bfbc9a54bad301 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Tue, 2 Aug 2022 13:04:51 -0400 Subject: [PATCH 2/2] Update _index.md --- content/pipeline/docker/syntax/cloning/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pipeline/docker/syntax/cloning/_index.md b/content/pipeline/docker/syntax/cloning/_index.md index 2620b1806..1e1aa2faa 100644 --- a/content/pipeline/docker/syntax/cloning/_index.md +++ b/content/pipeline/docker/syntax/cloning/_index.md @@ -78,7 +78,7 @@ steps: - go test {{< / highlight >}} -# retries +# Retries By default, the clone step will fail if any of the git commands fail. This can be altered by setting a number of retries. When this is set, the failing command will be rerun the given number of times, and the step will only be marked as failure if none of the tries are successful. For example: