deployphp / deployer

The PHP deployment tool with support for popular frameworks out of the box
https://deployer.org
MIT License
10.56k stars 1.48k forks source link

Allow variable for shared path #3762

Closed lfolco closed 2 weeks ago

lfolco commented 8 months ago

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

Fund with Polar

Schrank commented 8 months ago

Hey @lfolco 👋

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

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

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)
Schrank commented 8 months ago

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.

github-actions[bot] commented 2 weeks ago

This issue has been automatically closed. Please, open a discussion for bug reports and feature requests.

Read more: [https://github.com/deployphp/deployer/discussions/3888]