deployer icon indicating copy to clipboard operation
deployer copied to clipboard

Allow variable for shared path

Open lfolco opened this issue 1 year ago • 3 comments

Currently, in the [shared.php](deploy:shared) it gets the shared path as a child of the deploy path:

task('deploy:shared', function () {
    $sharedPath = "{{deploy_path}}/shared";
    ...
}

We have a multi-site setup where the shared directory is a sibling of our other sites. It would be great if we could specify that sharedPath variable in deploy.php.

Thanks!

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

lfolco avatar Jan 09 '24 19:01 lfolco

Hey @lfolco 👋

Did you try to do it manually and run it though parse() ?

task('deploy:shared', function () {
    $sharedPath = parse("{{deploy_path}}/shared");
    ...
}

Schrank avatar Jan 09 '24 19:01 Schrank

Not sure I follow, in our setup our shared path does not reside within our deploy directory at all:

<root>/shared
-------site1
-------site2
<root>/site1
<root>/site2

So within the `deploy:shared` task, I would need to set the private variable `$sharedPath` (trying to avoid overriding the task if possible)

lfolco avatar Jan 09 '24 19:01 lfolco

NOW I get what you want. I assumed, that the shared path is a variable you could use like {{shared_path}} and somewhere is a set('shared_path', function() {... }) - but this is not the case 😮

I think this is something worth implementing 🤔

Then you could just overwrite the set and do whatever you want.

Schrank avatar Jan 09 '24 20:01 Schrank