mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 01:02:24 +01:00
The server function now automatically registers the 'name' and 'host' environment variables, based on the given parameters.
This commit is contained in:
parent
a554494ff3
commit
56291d33c8
@ -35,12 +35,12 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
* @param int $port
|
||||
* @return Builder
|
||||
*/
|
||||
function server($name, $domain = null, $port = 22)
|
||||
function server($name, $host = null, $port = 22)
|
||||
{
|
||||
$deployer = Deployer::get();
|
||||
|
||||
$env = new Environment();
|
||||
$config = new Configuration($name, $domain, $port);
|
||||
$config = new Configuration($name, $host, $port);
|
||||
|
||||
if ($deployer->parameters->has('ssh_type') && $deployer->parameters->get('ssh_type') === 'ext-ssh2') {
|
||||
$server = new Remote\SshExtension($config);
|
||||
@ -51,6 +51,10 @@ function server($name, $domain = null, $port = 22)
|
||||
$deployer->servers->set($name, $server);
|
||||
$deployer->environments->set($name, $env);
|
||||
|
||||
// Setting environment variables about the server automatically
|
||||
$env->set('name', $server);
|
||||
$env->set('host', $host);
|
||||
|
||||
return new Builder($config, $env);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user