Skip to content

Commit 9aa875b

Browse files
committed
use table in config ref and add note about immediate start with no delay supplied
1 parent f793f7b commit 9aa875b

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

docs/guides/modules/orchestrate/pages/automatic-reruns.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This section provides config examples to help you set up automatic reruns. The c
3333

3434
To enable automatic reruns for a run step in a job, add the `max_auto_reruns` key to your step with a value between 1 and 5:
3535

36-
NOTE: Automatic reruns are only supported for `run` steps, not special steps like `checkout` or `setup_remote_docker`.
36+
NOTE: Automatic reruns are only supported for `run` steps, not special steps like `checkout` or `setup_remote_docker`. Also you must configure the `command` key for the step, you cannot use the short form run step configuration.
3737

3838
.CircleCI config to automatically retry a step up to 3 times if it fails
3939
[source,yaml]
@@ -44,14 +44,14 @@ jobs:
4444
my-job:
4545
steps:
4646
- run: echo "Hello, world!"
47-
- run:
47+
- run:
4848
command: echo "This step will automatically rerun up to 3 times if it fails"
4949
max_auto_reruns: 3
5050
----
5151

5252
You can add a delay between the step failing and the automatic rerun starting, as follows:
5353

54-
NOTE: If you configure a delay for your automatic step rerun, the delay must be less than or equal to 10 minutes. The delay can be configured as a string with a unit suffix, using `m` (minutes) or `s` (seconds), for example, `auto_rerun_delay: 10s` or `auto_rerun_delay: 3m`.
54+
NOTE: If you configure a delay for your automatic step rerun, the delay must be less than or equal to 10 minutes. The delay can be configured as a string with a unit suffix, using `m` (minutes) or `s` (seconds), for example, `auto_rerun_delay: 10s` or `auto_rerun_delay: 3m`. If you do not supply a delay, the rerun will start immediately after the step fails.
5555

5656
.CircleCI config to automatically retry a step up to 3 times if it fails with a 10 second delay between attempts
5757
[source,yaml]
@@ -62,7 +62,7 @@ jobs:
6262
my-job:
6363
steps:
6464
- run: echo "Hello, world!"
65-
- run:
65+
- run:
6666
command: echo "This step will automatically rerun up to 3 times if it fails with a 10 second delay between attempts"
6767
max_auto_reruns: 3
6868
auto_rerun_delay: 10s

docs/reference/modules/ROOT/pages/configuration-reference.adoc

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,26 @@ A job can exit without failing by using `run: circleci-agent step halt`. However
15681568
15691569
==== Automatic step reruns
15701570
1571-
The `max_auto_reruns` and `auto_rerun_delay` attributes can be used to automatically rerun a step if it fails, and delay that rerun if required. Automatic reruns are useful for steps that are expected to fail intermittently, such as tests.
1571+
The following attributes can be used to automatically rerun a step if it fails, and delay that rerun if required:
1572+
1573+
[cols="2,1,1,2"]
1574+
|===
1575+
| Key | Required | Type | Description
1576+
1577+
|`max_auto_reruns`
1578+
| N
1579+
| Integer
1580+
| The maximum number of times to automatically rerun the step if it fails. Must be between `1` and `5`.
1581+
1582+
| `auto_rerun_delay`
1583+
| N
1584+
| String
1585+
| The delay between reruns of the step if it fails. This delay can only be set along with `max_auto_reruns`. The string is a decimal with unit suffix using either seconds `s` or minutes `m` up to a maximum of 10 minutes, such as "10s", "2m". If you do not supply a delay, the rerun will start immediately after the step fails.
1586+
|===
1587+
1588+
Automatic reruns are only supported for `run` steps, not special steps like `checkout` or `setup_remote_docker`.
1589+
1590+
You must configure the `command` key for the step, you cannot use the short form run step configuration, for example, the following is not supported for use with automatic reruns: `- run: echo "Hello, world!"`
15721591
15731592
*Example:*
15741593

0 commit comments

Comments
 (0)