crazy-max / swarm-cronjob

Create jobs on a time-based schedule on Docker Swarm
https://crazymax.dev/swarm-cronjob/
MIT License
760 stars 70 forks source link

Ability to trigger cron job via swarm-cronjob cli #281

Open ieugen opened 1 year ago

ieugen commented 1 year ago

Description

Hi,

I think it would be very useful to have the ability to trigger a job via swarm-cronjob cli. This should be useful for manual triggering of jobs for testing the job will work properly.

I think a cli like would do the trick

swarm-cronjob run job_name 

where job-name is the name of the service implementing the job.

ieugen commented 1 year ago

To clarify (if needed), I am suggesting users could exec into the swarm-cronjob container and run the cli from there.

ieugen commented 1 year ago

Another idea is to use a swarm-cronjob cli that can talk with a swarm-cronjob API ?! This would be better than the exec option since docker exec does not work in swarm - you need to connect to the node first.