TaskNinja Wiki (v2) - RikunjSindhwad/Task-Ninja GitHub Wiki

TaskNinja is a versatile task automation framework designed to simplify and streamline repetitive tasks. With TaskNinja, you can define workflows, manage dependencies, and automate complex processes with ease. Task ninja splits tasks with the docker containers and with additional functionality its easy to manage multiple tasks with simple yaml file

                                                                            
                                                              .:--                        
                                                        :=*#%@@@@#                        
                                    :::::.            =%@@#*++===.                        
                               .=*%@@@@@@@@#+:        :%@@*:                              
                             :*@@@@@@@@@@@@@@@*.        =%@@+                             
                            *@@@@@@@@@@@@@@@@@@%:     .=%@@#:                             
                           #@@@@@@@@@@@@#+=+@@@@%  :=*@@%*++#%%%#*+=:.                    
                          =@@@@@@@@@#+-    =@@@@@%@%#+-:  +%@@%++#%@@#:                   
                          =++**++=:  :--   *@@@@@%#*+====+*#@@@:   :.                     
                          . -      :==-   .%@@@@@=-=*##%%%%#*=.                           
                   :=+=     .=*#*+=-:::::=%@@@@@%                                         
                 -%@@%-     *@@@@@@@@@@@@@@@@@@*..:::-----====---:..                      
                *@@@@@=      =%@@@@@@@@@@@@@@@@%@@@@@@@@@@@@@@@@@@@@%#*+-.                
              .#@@@%+:        .#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%*:             
              #@@@+        -+#%@@@@@@@@@@@@@@@@@@@@@@@@@@@%%#*******#%%@@@@@@+            
             #@@@@=   :-+#@@@@@@@@@@@@@@@@@@@@@@@@@@@#+=:.             *@@@@%-            
            +@@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@@@%*-                    :--.              
            *@@@@@@@@@@@@@@%@@@@@@@@@@@@@@@@@@@%=                                         
             =*#%%@@@@@@@@%+@@@@@@@@@@@@@@@@@@#                                           
                           .@@@@@@@@@@@@@@@@@%.                                           
                            *@@@@@@@@@@@@@@@@%                                            
                             +@@@@@@@@@@@@@@@@.                                           
                              .+%@@@@@@@@@@@@@#                                           
                                 :=*%@@@@@@@@@@*                                          
                                     .-=*#%@@@@@#.                                        
                                           .:-+*#%-                                       
                                                  ..                                      
                                                                   
 ____,   ____, ____,  __, ,    _,  _, __,   _,  _,  _,    ____,
(-|     (-/_| (-(__  ( |_/    (-|\ | (-|   (-|\ |  (-|   (-/_| 
 _|,    _/  |, ____)  _| \,    _| \|, _|_,  _| \|, __|,  _/  |,
(      (      (      (        (      (     (      (     (      
         Made For 🥷  by Robensive                               Version=2.0
================================================================================

Table of Contents

Getting Started

To get started with TaskNinja, follow these steps:

  1. Installation: Learn how to install TaskNinja on your system.
git clone https://github.com/RikunjSindhwad/Task-Ninja.git
cd Task-Ninja
go build
./Robensive-TaskNinja

Workflow Guide

Workflows in TaskNinja help you define and automate a series of tasks. Learn how to create and manage workflows:

Watch on youtube

Below flowchart explains the behind the scene of workflow.

Task-NinjaWC

Example: Structure of workflows

image

Structure is divided into 3 parts config,vars,tasks

  1. Config: All the possible global config for the workflow can be defined here. It allows below inputs
  • Name: Workflow Name
  • Author: Workflow Author Name
  • Usage: Display Usage of workflow when no variable supplied
  • Shell: Default shell to use (bash||sh||powershell) [deprecated]
  • defaultimage: Default docker image to be used when no image is specified in the tasks
  • hive: Local folder to store task data (default: ./hive)
  • logs: A bool input for enable disable logs (default: false)

  1. Vars: Vars contains variables that can be reused in the workflow, It will act like placeholder for curley braces {{}} containing defained variable name in the command, inputs, dynamicFile which are part of tasks structure

  1. tasks: Tasks containes configuration of difference tasks and their command with some additional features that it offeres.
  • Name: A string representing the name of the task. (Taskname is also used for creating directory for input , output and logs)
  • Image: A string specifying the Docker image to be used for the execution. (Multiple dockers are created for educational perposes at https://hub.docker.com/u/robensive)
  • DockerHive: A string indicating the folder to used within docker container for mounting. (same as -v sourcefolder:destinationfolder)
  • Cmds: An list of strings, each representing a command to be executed in the task. [NOTE] It will use && to join the list values.
  • Silent: A boolean indicating whether the task should run in silent mode. (When enabled response will not be visible)
  • Parallel: A boolean to determine if the task can be executed in the background and execute next tasks parallel.
  • Required: An array of strings, each specifying a task that must be completed before this one starts.
  • Timeout: An integer representing the timeout duration for the task. (default: 1 DAY)
  • StoponError: A boolean indicating whether the task execution should stop on encountering an error.
  • Type: A string representing the type of the task. (Dynamic || static)
  • DynamicFile: A string for specifying a dynamic file in the dynamic type task, it will take 1 line at a time and execute the tasked command.
  • DynamicRange: A string for specifying a dynamic range in the task. It will take rotates through specified range and returns 1 int at a time
  • MaxThreads: An integer indicating the maximum number of threads for the dynamictask.
  • InputMouts: An array of strings, each representing a mount input for the task. Mount require just task name to mount a speicfic file/folder
  • Inputs: An array of strings, each representing an input for the task. The input allows folder/file and web url which will be saved in current task input directory. with coma , as seperator, we can define file name for file and web based inputs.

Contributing

We welcome contributions from the community. If you'd like to contribute to TaskNinja, please follow our Contribution Guidelines.

License

TaskNinja is open-source software released under the MIT License. Feel free to use, modify, and distribute it according to the terms of the license.