An open API service indexing awesome lists of open source software.

https://github.com/derekantrican/clockworkframework

An automation framework (running individual tasks on their own intervals) written in C#
https://github.com/derekantrican/clockworkframework

automation automation-framework csharp dotnet dotnet-core

Last synced: 2 months ago
JSON representation

An automation framework (running individual tasks on their own intervals) written in C#

Awesome Lists containing this project

README

          

# Clockwork

[![NuGet version (ClockworkFramework.Core)](https://img.shields.io/nuget/v/ClockworkFramework.Core.svg?style=flat-square)](https://www.nuget.org/packages/ClockworkFramework.Core/)

A basic automation framework for running tasks on an interval. Useful for things like periodically accessing an API, sending daily emails, etc

### Getting started

0. *Install .NET 8 if you do not have it installed already*
1. Clone the repo
2. Run `dotnet build`
3. Running the resulting executable will run the example tasks

**To set up your own library of tasks:**
1. Create a folder (ideally, not inside the ClockworkFramework folder)
2. Run `dotnet new console`
3. Run `dotnet add package ClockworkFramework.Core`
4. Add one or more classes that implement `IClockworkTaskBase` and a method with the `[TaskMethod]` & `[Interval(..)]` attributes (see [Examples](https://github.com/derekantrican/ClockworkFramework/tree/master/ClockworkFramework/Examples))

*For some common needs like calling an API or running a process you can use the `Utilties` class. See [ExampleApiTask](https://github.com/derekantrican/ClockworkFramework/blob/master/ClockworkFramework/Examples/ExampleApiTask.cs)*

5. In the same directory as ClockworkFramework.exe create `config.json`. Here is an annotated example:

```jsonc
{
"repositoryUpdateFrequency" : 5, // How often to update each library's repository (if it is a git repository) in minutes
"libraries" : [
{
"path" : "..\\..\\ClockworkTasks", // The path to the library. Can be relative or absolute. Can be a folder (containing a csproj), a csproj, or a dll
"updateRepository" : true // Whether to update the repository (with `git pull`) on the cadence in repositoryUpdateFrequency
}
]
}
```

6. Run the ClockworkFramework.exe to load your new library