Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit c7d8d1b

Browse files
authored
Merge pull request #11 from fd6130/patch
Add deploy_dir option by server
2 parents edb8bd4 + e51399c commit c7d8d1b

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

doc/default-deployer.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ public function configure()
3737
}
3838
```
3939

40+
You can optionaly define the root directory per server:
41+
```php
42+
public function configure()
43+
{
44+
return $this->getConfigBuilder()
45+
->server('user@hostname', ['app'], [
46+
'deploy_dir' => '/var/www/my-project',
47+
])
48+
// ...
49+
;
50+
}
51+
```
52+
4053
Then, the following directory structure is created on each remote server:
4154

4255
```

src/Configuration/DefaultConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ public function resetOpCacheFor(string $homepageUrl): self
375375

376376
protected function getReservedServerProperties(): array
377377
{
378-
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];
378+
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];
379379
}
380380

381381
/**

src/Deployer/DefaultDeployer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private function initializeServerOptions(): void
194194
$appServers = $this->getServers()->findByRoles([Server::ROLE_APP]);
195195
foreach ($appServers as $server) {
196196
$this->log(sprintf('<h3>Setting the %s property for <server>%s</> server</>', Property::deploy_dir, $server));
197-
$server->set(Property::deploy_dir, $this->getConfig(Option::deployDir));
197+
$server->set(Property::deploy_dir, $server->get(Property::deploy_dir, $this->getConfig(Option::deployDir)));
198198
}
199199
}
200200

0 commit comments

Comments
 (0)