Skip to content

Commit

Permalink
Add deploy_dir option by server
Browse files Browse the repository at this point in the history
  • Loading branch information
fd6130 committed Nov 12, 2021
1 parent 49387dd commit e51399c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions doc/default-deployer.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ public function configure()
}
```

You can optionaly define the root directory per server:
```php
public function configure()
{
return $this->getConfigBuilder()
->server('user@hostname', ['app'], [
'deploy_dir' => '/var/www/my-project',
])
// ...
;
}
```

Then, the following directory structure is created on each remote server:

```
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/DefaultConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public function resetOpCacheFor(string $homepageUrl): self

protected function getReservedServerProperties(): array
{
return [Property::bin_dir, Property::config_dir, Property::console_bin, Property::cache_dir, Property::deploy_dir, Property::log_dir, Property::src_dir, Property::templates_dir, Property::web_dir];
return [Property::bin_dir, Property::config_dir, Property::console_bin, Property::cache_dir, Property::log_dir, Property::src_dir, Property::templates_dir, Property::web_dir];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Deployer/DefaultDeployer.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private function initializeServerOptions(): void
$appServers = $this->getServers()->findByRoles([Server::ROLE_APP]);
foreach ($appServers as $server) {
$this->log(sprintf('<h3>Setting the %s property for <server>%s</> server</>', Property::deploy_dir, $server));
$server->set(Property::deploy_dir, $this->getConfig(Option::deployDir));
$server->set(Property::deploy_dir, $server->get(Property::deploy_dir, $this->getConfig(Option::deployDir)));
}
}

Expand Down

0 comments on commit e51399c

Please sign in to comment.