Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.8 KB

README.md

File metadata and controls

36 lines (27 loc) · 1.8 KB

Clockwork

NuGet version (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

  1. Install .NET 6 if you do not have it installed already
  2. Clone the repo
  3. Run dotnet build
  4. 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)

    For some common needs like calling an API or running a process you can use the Utilties class. See ExampleApiTask

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

{
    "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
        }
    ]
}
  1. Run the ClockworkFramework.exe to load your new library