Skip to content

Commit 538d47d

Browse files
committed
Update hosts.md
1 parent 1f488ac commit 538d47d

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/hosts.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,39 @@ Host *
8787
|`setLabels` | Key-value pairs for host selector. |
8888
|`setSshArguments` | For example, `['-o UserKnownHostsFile=/dev/null']` |
8989

90+
## Multiple hosts
91+
92+
You can pass multiple hosts to the host function:
93+
94+
```php
95+
host('example.org', 'deployer.org', ...)
96+
->setRemoteUser('anton');
97+
```
98+
99+
## Host ranges
100+
101+
If you have a lot of hosts following similar patterns, you can describe them
102+
like this rather than listing each hostname:
103+
104+
```php
105+
host('www[01:50].example.org');
106+
```
107+
108+
For numeric patterns, leading zeros can be included or removed, as desired.
109+
Ranges are inclusive.
110+
111+
You can also define alphabetic ranges:
112+
113+
```php
114+
host('db[a:f].example.org');
115+
```
116+
117+
## Localhost
118+
119+
A special function [localhost()](api.md#localhost) defines a special local host.
120+
Deployer will not connect to this host and will execute commands locally.
121+
122+
```php
123+
localhost(); // Alias and hostname will be "localhost".
124+
localhost('ci'); // Alias is "ci", hostname is "localhost".
125+
```

0 commit comments

Comments
 (0)