-
-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Ability to add tasks to a "trigger group" like deploy:
class AppScheduleBuilder implements ScheduleBuilder
{
public function buildSchedule(Schedule $schedule): void
{
$schedule->addCommand('app:warm-cache')
->trigger('deploy')
->unscheduled() // disables task from bring run except when "triggered"
;
$schedule->addCommand('app:health-check')
->hourly() // also runs hourly
->trigger('deploy', priority: 10) // would run before the above task
;
// ...
}
}Run the trigger (ie in a post deployment script):
bin/console schedule:trigger deployCombined with #58:
#[Schedule('@daily', trigger: 'deploy')]
class MyService
{
public function __invoke()
{
// ...
}
}
#[Schedule('@weekly', trigger: 'deploy')]
class MyCommand extends Command
{
public function execute(InputInterface $input, OutputInterface $output): int
{
// ...
}
}A dedicated Trigger attribute could be added to make unscheduled invokable service/console command tasks:
#[Trigger('deploy')]
class MyService
{
public function __invoke()
{
// ...
}
}
#[Trigger('deploy')]
class MyCommand extends Command
{
public function execute(InputInterface $input, OutputInterface $output): int
{
// ...
}
}eerison
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request