Task Scheduler



  • Hi,
    I think it would be great to have a simple scheduler for deployment tasks in CloneDeploy.

    And as I already searched the forum I found that the response was more or less "you could use the API".

    I did exactly that and was able to fulfill my needs.

    I started to develop a standalone asp dotnet core 2.1 server, got it working with the CloneDeploy API and used Hangfire as a job scheduler together with a redis database currently.

    This is how it looks:

    001-Standalone.png

    When I had all of it working, I thought, let's have a look, if I could get it somehow working directly integrated in the web interface of CloneDeploy.

    Working through the code I found out that you already have an instance of hangfire in the code, doing a check for the cluster.

    So I tried to get it working with that instance, and was successful in the end.
    It was more work in many different files as I thought, but it works.

    This is how it looks:

    002-CloneDeploy-Integration.png

    Currently it only uses the memory storage that was used, but there seems to be a way to have another instance running that could use the database to keep the jobs because with the memory storage, all scheduled jobs will be gone after a restart.

    I added the scheduler with an existing notepad icon, this should be a clock later.
    The Date selector has a small incompatibility currently, it works but might need some love.

    I don't know if there is any interest in adding such a feature or if it is already in the planning/works?
    I could prepare and share the code if it helps.



  • I've thought about this, but I'm not sure how beneficial it is. It seems like someone would still need to be around to keep an eye on things, such as restarting computers that are currently on, or powering on computers that didn't wake up. Also, I don't believe anyone has ever asked for this feature. Thanks for your efforts though. It is something I could possibly add in the future. Right now I don't want to add anything new. There are still some bugs that need worked out, and I want to get CloneDeploy nearly perfect before adding anything.



  • @clonedeploy_admin said in Task Scheduler:

    om

    Thanks for your reply.

    So it is best (easy) for me to keep it separated, because if a new update is released, I would need to merge my changes again.

    Yes, one would have to manage the clients and their reboots.
    I simply have a scheduled task in my Windows images that force a reboot at the weekends.

    If a computer would be powered off, it would be deployed with the next start, taking just some minutes is not a big problem.
    Others use WOL to wake up computers if they are powered off, but that is currently not a problem for me.

    I was thinking about using SSH as the new Windows Servers would support it, then one would need to manage permission /
    accounts to access the clients or allow the CloneDeploy computeraccount or something like this, that could be integrated in CloneDeploy as central management and would work for Linux, too.

    But I went with the scheduled task for now. Start simple.

    And just fyi these were the questions regarding scheduling / api:
    https://forum.clonedeploy.org/topic/803/scheduled-deployment
    https://forum.clonedeploy.org/topic/808/api-documentation