Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion recipe/deploy/shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
$sharedPath = "{{deploy_path}}/shared";

foreach (get('shared_dirs') as $dir) {
$parentDir = dirname($dir);

// Create shared dir if it does not exist.
run("mkdir -p $sharedPath/$dir");

// Copy shared dir files if they does not exist.
run("if [ -d $(echo {{release_path}}/$dir) ]; then cp -rn {{release_path}}/$dir $sharedPath; fi");
run("if [ -d $(echo {{release_path}}/$dir) ]; then cp -rn {{release_path}}/$dir $sharedPath/$parentDir; fi");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second look - would I want anything copied from my release path into my shared storage once shared storage is established? Seems like possible risk of unwanted / unexpected overwrite if I happen to have placeholder in my release tree. For example, if my release tree contained a shell sqlite DB file that I want to be shared/retained across releases, this copy would always reset back to the release tree version.

Maybe the copy from release tree should only be if $sharedPath/$dir doesn't yet exist? Your prior ticket indicated this change was trying to repair a first time deploy issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind - I now the the -n option on cp that prevents overwrite.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your prior ticket indicated this change was trying to repair a first time deploy issue.

This is true. And i think to add this later, and remove -n flag (#894).


// Remove from source.
run("if [ -d $(echo {{release_path}}/$dir) ]; then rm -rf {{release_path}}/$dir; fi");
Expand Down