deployer icon indicating copy to clipboard operation
deployer copied to clipboard

Allow add() in deploy.yaml

Open solverat opened this issue 3 years ago • 10 comments

Using this as example:

import: recipe/symfony.php

config:
    shared_dirs:
        - my_dir

Result of get('shared_dirs'): ['my_dir']

But sometimes I may want to have a result like this: ['var/log' ,'my_dir']. A solution would be to move the import node after the config node, but this might be error-prone.

WDYT?

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

solverat avatar Nov 24 '21 10:11 solverat

I’m thinking on adding add: option.

antonmedv avatar Nov 24 '21 10:11 antonmedv

YAML can this already, maybe this helps: https://stackoverflow.com/q/24090177/1480397

Schrank avatar Nov 24 '21 12:11 Schrank

I'm in the same situation explained by @solverat but for a laravel recipe, i need to "append" values to following configurations: shared_files, writable_dirs, writable_dirs.

Solution by @Schrank is not applicable because initial values are placed by laravel recipe using add function, they are not in the yaml, so we cannot refer to them.

Solution by @antonmedv will be ideal to "append" values instead of "set" them.

Please let me know if i can help in any way, i'm not deep in new version code, but i can give it a try or i can help to validate the solution once in place!

luke83 avatar Apr 15 '22 16:04 luke83

In PHP you can use add() instead of set()

peterjaap avatar Apr 15 '22 16:04 peterjaap

Hi @peterjaap, yes i know, the issue is to have something similar in yaml new format (7.x)

luke83 avatar Apr 15 '22 16:04 luke83

I think this will be in Deployer v7.1. Right now I want to release v7.0.

antonmedv avatar Apr 15 '22 19:04 antonmedv

I think this will be in Deployer v7.1. Right now I want to release v7.0.

any news about this feature request?

luke83 avatar Oct 25 '22 13:10 luke83

Nope. Boost feature request interest with donations)

antonmedv avatar Oct 25 '22 14:10 antonmedv

@antonmedv We have the same problem. Do you want an "add" or is it ok for the moment to merge by default?

Schrank avatar Feb 27 '24 09:02 Schrank

And I'm talking about

  • add('shared_files', ['.env']);
  • add('shared_dirs', ['vendor', 'node_modules']);
  • add('writable_dirs', ['bootstrap/cache', 'storage']);

But happy to take care of more

Schrank avatar Feb 27 '24 09:02 Schrank