mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
Add stare and roles helpers
This commit is contained in:
parent
66b40c7259
commit
67ecaebe20
15
UPGRADE.md
15
UPGRADE.md
@ -2,9 +2,10 @@
|
||||
|
||||
1. Servers to Hosts
|
||||
|
||||
* Refactor `server($name, $hostname)` to `host($hostname)`
|
||||
* Refactor `localServer($name)` to `localhost()`
|
||||
* Rename `serverList($file)` to `inventory($file)`
|
||||
* `server($name, $hostname)` to `host($hostname)`
|
||||
* `localServer($name)` to `localhost()`
|
||||
* `cluster($name, $nodes, $port)` to `hosts(...$hodes)`
|
||||
* `serverList($file)` to `inventory($file)`
|
||||
|
||||
2. Configuration options
|
||||
|
||||
@ -35,6 +36,14 @@
|
||||
get('a_b');
|
||||
```
|
||||
|
||||
4. Credentials
|
||||
|
||||
Best practice in new v5 is to omit credentials for connection in `deploy.php` and write them in `~/.ssh/config` instead.
|
||||
|
||||
* `identityFile($publicKeyFile,, $privateKeyFile, $passPhrase)` to `identityFile($privateKeyFile)`
|
||||
* `pemFile($pemFile)` to `identityFile($pemFile)`
|
||||
* `forwardAgent()` to `forwardAgent(true)`
|
||||
|
||||
# Upgrade from 3.x to 4.x
|
||||
|
||||
1. Namespace for functions
|
||||
|
@ -59,7 +59,7 @@ trait ConfigurationAccessor
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Configuration option
|
||||
* Add configuration option
|
||||
*
|
||||
* @param string $name
|
||||
* @param array|bool|int|string $value
|
||||
@ -70,4 +70,33 @@ trait ConfigurationAccessor
|
||||
$this->configuration->add($name, $value);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set stage
|
||||
*
|
||||
* @param string $stage
|
||||
* @return $this
|
||||
*/
|
||||
public function stage(string $stage)
|
||||
{
|
||||
$this->configuration->set('stage', $stage);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set roles
|
||||
*
|
||||
* @param array ...$roles
|
||||
* @return $this
|
||||
*/
|
||||
public function roles(...$roles)
|
||||
{
|
||||
$this->configuration->set('roles', []);
|
||||
|
||||
foreach ($roles as $role) {
|
||||
$this->configuration->add('roles', $role);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user