deployphp / deployer

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

Crontab: Rewrite the crontab recipe to work with sections #3708

Closed ardentsword closed 1 year ago

ardentsword commented 1 year ago

Rewrite of the crontab contrib recipe. It creates a 'section' in the crontab without modifying the original crontab (before the whole crontab was wiped). If the cronjobs are modified it only touches the section. This removes the need to remove old 'unused' cronjobs when changing the command.

antonmedv commented 1 year ago

Is it a breaking change?

ardentsword commented 1 year ago

It is not breaking for the config, but it is indeed breaking in that it duplicates the rules if they are already there. I could write some code to check for duplicates and remove those 'outside' of the section, would that be the preferred solution?

antonmedv commented 1 year ago

Yes, lets try this.

ardentsword commented 1 year ago

I added the new code, let me know what you think of it :)

SimJoSt commented 10 months ago

@ardentsword thank you for the rewrite. It makes working with crontab much smoother and structured. Great work!

ardentsword commented 10 months ago

@SimJoSt Thanks, you're welcome, glad to hear it is getting used :)