GithubHelp home page GithubHelp logo

spryker-scheduler's Introduction

spryker-scheduler

Replace Jenkins in your spryker setup

Use peppeocchi/php-cron-scheduler instead of Jenkins to save resources.

Installation

composer require B3NNU3/spryker-scheduler

Copy files from: config/Zed/cronjobs to YOUR_PROJECT_ROOT/config/Zed/cronjobs/
Add the following to src/Pyz/Zed/Console/ConsoleDependencyProvider.php

[...]
use B3NNU3\Zed\CronScheduler\Communication\Console\CronSchedulerCreate;
use B3NNU3\Zed\CronScheduler\Communication\Console\CronSchedulerExecute;
use B3NNU3\Zed\CronScheduler\Communication\Console\CronSchedulerRemove;
[...]

    /**
     * @param \Spryker\Zed\Kernel\Container $container
     *
     * @return \Symfony\Component\Console\Command\Command[]
     */
    protected function getConsoleCommands(Container $container): array
    {
        $commands = parent::getConsoleCommands($container);

        [...]
        $commands[] = new CronSchedulerExecute();
        $commands[] = new CronSchedulerCreate();
        $commands[] = new CronSchedulerRemove();
        [...]

        return $commands;
    }

run

vendor/bin/console transfer:generate

Run the following to set the scheduler script to your crontab

cron:scheduler:create

Usage

The cron will execute in every minute.
And will run every command from the scheduler.php
If a command starts the scheduler will create a .lock file for it in data/CLI/scheduler/COMMAND_NAME.lock
For more information see peppeocchi/php-cron-scheduler

Miscellaneous

Please also take a look at you install-recipes at /config/install

You should replace the following
Instead of:

    jenkins-down:
        jenkins-stop:
            command: "vendor/bin/console scheduler:clean"
            stores: true

use:

    scheduler-down:
        remove-cron:
            command: "vendor/bin/console cron:scheduler:remove"

and instead of

    jenkins-up:
        jenkins-generate:
            command: "vendor/bin/console scheduler:setup"
            stores: true

        jenkins-enable:
            command: "vendor/bin/console scheduler:resume"
            stores: true

use:

    scheduler-up:
        crons-enable:
            command: "vendor/bin/console cron:scheduler:create"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.