Using param's value inside (#1541)

* Parse Host params

* update changelog
This commit is contained in:
GoodVibesDevelopment 2018-04-18 06:34:39 +02:00 committed by Anton Medvedev
parent 88e4085f58
commit 4d0df304f9
3 changed files with 18 additions and 6 deletions

View File

@ -1,10 +1,10 @@
# Changelog # Changelog
## master ## master
[v6.1.0...master](https://github.com/deployphp/deployer/compare/v6.1.0...master)
### Added ### Added
- Added cache clear/warmup task for symfony4 recipe [#1575] - Added cache clear/warmup task for symfony4 recipe [#1575]
- Added ability to use config params in host variables [#1508]
- Make used shell configurable via `shellCommand` [#1536] - Make used shell configurable via `shellCommand` [#1536]
### Fixed ### Fixed
@ -375,6 +375,7 @@
[#1536]: https://github.com/deployphp/deployer/pull/1536 [#1536]: https://github.com/deployphp/deployer/pull/1536
[#1521]: https://github.com/deployphp/deployer/pull/1521 [#1521]: https://github.com/deployphp/deployer/pull/1521
[#1513]: https://github.com/deployphp/deployer/pull/1513 [#1513]: https://github.com/deployphp/deployer/pull/1513
[#1508]: https://github.com/deployphp/deployer/issues/1508
[#1488]: https://github.com/deployphp/deployer/issues/1488 [#1488]: https://github.com/deployphp/deployer/issues/1488
[#1481]: https://github.com/deployphp/deployer/issues/1481 [#1481]: https://github.com/deployphp/deployer/issues/1481
[#1480]: https://github.com/deployphp/deployer/issues/1480 [#1480]: https://github.com/deployphp/deployer/issues/1480

View File

@ -49,7 +49,7 @@ class Host
} }
if ($this->identityFile) { if ($this->identityFile) {
$this->sshArguments = $this->sshArguments->withFlag('-i', $this->identityFile); $this->sshArguments = $this->sshArguments->withFlag('-i', $this->getIdentityFile());
} }
if ($this->forwardAgent) { if ($this->forwardAgent) {
@ -73,7 +73,7 @@ class Host
*/ */
public function getHostname() public function getHostname()
{ {
return $this->hostname; return $this->config->parse($this->hostname);
} }
/** /**
@ -81,7 +81,7 @@ class Host
*/ */
public function getRealHostname() public function getRealHostname()
{ {
return $this->realHostname; return $this->config->parse($this->realHostname);
} }
/** /**
@ -107,7 +107,7 @@ class Host
*/ */
public function getUser() public function getUser()
{ {
return $this->user; return $this->config->parse($this->user);
} }
/** /**
@ -161,7 +161,7 @@ class Host
*/ */
public function getIdentityFile() public function getIdentityFile()
{ {
return $this->identityFile; return $this->config->parse($this->identityFile);
} }
/** /**

View File

@ -73,4 +73,15 @@ class HostTest extends TestCase
self::assertEquals('host/alias', $host->getHostname()); self::assertEquals('host/alias', $host->getHostname());
self::assertEquals('host', "$host"); self::assertEquals('host', "$host");
} }
public function testHostWithParams()
{
$host = new Host('host');
$value = 'new_value';
$host
->set('env', $value)
->identityFile('{{env}}');
self::assertEquals($value, $host->getIdentityFile());
}
} }