File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,8 +23,20 @@ set('shared_dirs', ['storage']);
2323
2424
2525
26+ ### shared_dirs_populate
27+ [ Source] ( https://github.com/deployphp/deployer/blob/master/recipe/deploy/shared.php#L18 )
28+
29+ When true, populate existing shared dirs with any new files/dirs present in the release.
30+ Useful when new subdirectories are added to the repo over time and should be propagated to shared.
31+ Existing files in shared are never overwritten.
32+
33+ ``` php title="Default value"
34+ false
35+ ```
36+
37+
2638### shared_files
27- [ Source] ( https://github.com/deployphp/deployer/blob/master/recipe/deploy/shared.php#L20 )
39+ [ Source] ( https://github.com/deployphp/deployer/blob/master/recipe/deploy/shared.php#L25 )
2840
2941List of files what will be shared between releases.
3042Each release will have symlink to those files stored in [ deploy_path] ( /docs/recipe/common.md#deploy_path ) /shared dir.
@@ -38,7 +50,7 @@ set('shared_files', ['.env']);
3850## Tasks
3951
4052### deploy\: shared {#deploy-shared}
41- [ Source] ( https://github.com/deployphp/deployer/blob/master/recipe/deploy/shared.php#L23 )
53+ [ Source] ( https://github.com/deployphp/deployer/blob/master/recipe/deploy/shared.php#L28 )
4254
4355Creates symlinks for shared files and dirs.
4456
Original file line number Diff line number Diff line change 1212// ```
1313set ('shared_dirs ' , []);
1414
15+ // When true, populate existing shared dirs with any new files/dirs present in the release.
16+ // Useful when new subdirectories are added to the repo over time and should be propagated to shared.
17+ // Existing files in shared are never overwritten.
18+ set ('shared_dirs_populate ' , false );
19+
1520// List of files what will be shared between releases.
1621// Each release will have symlink to those files stored in {{deploy_path}}/shared dir.
1722// ```php
4651 if (test ("[ -d $(echo {{release_path}}/ $ dir) ] " )) {
4752 run ("cp -r $ copyVerbosity {{release_path}}/ $ dir $ sharedPath/ " . dirname ($ dir ));
4853 }
54+ } elseif (get ('shared_dirs_populate ' ) && test ("[ -d $(echo {{release_path}}/ $ dir) ] " )) {
55+ // Populate shared dir with new files/dirs from release without overwriting existing content.
56+ run ("cp -r $ copyVerbosity --no-dereference --no-clobber {{release_path}}/ $ dir/. $ sharedPath/ $ dir/ " );
4957 }
5058
5159 // Remove from source.
You can’t perform that action at this time.
0 commit comments