Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a shopware 6 command as a cron job #47

Open
harli91 opened this issue Oct 3, 2024 · 3 comments
Open

Adding a shopware 6 command as a cron job #47

harli91 opened this issue Oct 3, 2024 · 3 comments

Comments

@harli91
Copy link

harli91 commented Oct 3, 2024

How do I add a Shopware 6 command as a cronjob using hypernode deploy?

@tdgroot
Copy link
Collaborator

tdgroot commented Oct 4, 2024

Hi Ivascu,

You can define custom deployer tasks by using Deployer\task:

use function Deployer\{run, task};

task('my:custom:task', static function () {
    run('cd {{release_path}} && bin/console run:some:command');
});

Then there are multiple ways to add the task in the deploy strategy:

Adding it to the end of the application-specific deployment tasks

$configuration->addDeployTask('my:custom:task');

Adding it before a specific task in the deploy strategy

use function Deployer\before;

before('deploy:symlink', 'my:custom:task');

Adding it after a specific task in the deploy strategy

use function Deployer\after;

after('deploy:symlink', 'my:custom:task');

I hope this answers your question :)

@harli91
Copy link
Author

harli91 commented Oct 4, 2024

@tdgroot I think you misunderstood, I want deploy a task that will update the crontab file with a command to execute a showare 6 command, or is there another way to manage the crontab entries ?

@poespas
Copy link

poespas commented Jan 6, 2025

@harli91 You can set up cron jobs with Hypernode Deploy by using PlatformConfiguration\CronConfiguration . More information on how to do this can be found here: https://docs.hypernode.com/hypernode-deploy/getting-started/configure-hypernode-settings-on-deployment.html#cron-configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants