2020-03-18 18:46:47 -04:00
|
|
|
Parameters common to all provisioners:
|
|
|
|
|
|
|
|
- `pause_before` (duration) - Sleep for duration before execution.
|
|
|
|
|
2020-04-16 05:58:54 -04:00
|
|
|
- `max_retries` (int) - Max times the provisioner will retry in case of failure. Defaults to zero (0). Zero means an error will not be retried.
|
|
|
|
|
2020-03-18 18:46:47 -04:00
|
|
|
- `only` (array of string) - Only run the provisioner for listed builder(s)
|
|
|
|
by name.
|
|
|
|
|
|
|
|
- `override` (object) - Override the builder with different settings for a
|
|
|
|
specific builder, eg :
|
|
|
|
|
2020-08-13 13:16:13 -04:00
|
|
|
In JSON:
|
2020-03-18 18:46:47 -04:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"type": "shell",
|
|
|
|
"script": "script.sh",
|
|
|
|
"override": {
|
2020-08-13 13:16:13 -04:00
|
|
|
"example_one": {
|
|
|
|
"script": "basic_one-script.sh"
|
2020-03-18 18:46:47 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-08-13 13:16:13 -04:00
|
|
|
In HCL2:
|
|
|
|
```hcl
|
|
|
|
build {
|
|
|
|
sources = ["docker.example_one", "docker.example_two"]
|
|
|
|
provisioner "shell" {
|
|
|
|
script = "script.sh"
|
|
|
|
override = {
|
|
|
|
example_one = {
|
|
|
|
script = "basic-one-script.sh"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-03-18 18:46:47 -04:00
|
|
|
- `timeout` (duration) - If the provisioner takes more than for example
|
|
|
|
`1h10m1s` or `10m` to finish, the provisioner will timeout and fail.
|