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

Nesting crontab config doesn't work #3769

Closed SimJoSt closed 2 weeks ago

SimJoSt commented 8 months ago
import:
  - contrib/crontab.php

config:
  crontab:
    identifier: 'application'
    jobs:
      - '* * * * * cd {{current_path}} && {{bin/php}} wp-cron.php >> /dev/null 2>&1'

As nesting is supported by the hosts node, supporting multiple remote hosts, I tried the same in the config node with the crontab config. Unfortunately, this configuration threw the following "error" (it just didn't recognize the config was set):

➜  dep crontab:sync
task crontab:sync
[linode.coders.fail] Nothing to sync - configure crontab:jobs

We had to switch to the following configuration, listing each option for crontab directly instead of nesting it:

config:
  ssh_copy_id: false
  crontab:identifier: 'hellseatic'
  crontab:jobs:
      - '* * * * * cd {{current_path}} && {{bin/php}} wp-cron.php >> /dev/null 2>&1'

Since the rewrite it seems to be mandatory, to provide an identifier, so the sections in the crontab work. It would also be great if it would work without one, using a fallback. That's another story, though.

Upvote & Fund

Fund with Polar

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]