Technical/Core

:init

Package to import Single task to import PIP package to install Stable version
rkd.standardlib rkd.standardlib.InitTask pip install rkd== SELECT VERSION https://badgen.net/pypi/v/rkd

This task runs ALWAYS. :init implements a possibility to inherit global settings to other tasks

:tasks

Package to import Single task to import PIP package to install Stable version
rkd.standardlib rkd.standardlib.TasksListingTask pip install rkd== SELECT VERSION https://badgen.net/pypi/v/rkd

Lists all tasks that are loaded by all chained makefile.py configurations.

Environment variables:

  • RKD_WHITELIST_GROUPS: (Optional) Comma separated list of groups to only show on the list
  • RKD_ALIAS_GROUPS: (Optional) Comma separated list of groups aliases eg. “:international-workers-association->:iwa,:anarchist-federation->:fa”

:version

Package to import Single task to import PIP package to install Stable version
rkd.standardlib rkd.standardlib.VersionTask pip install rkd== SELECT VERSION https://badgen.net/pypi/v/rkd

Shows version of RKD and lists versions of all loaded tasks, even those that are provided not by RiotKit. The version strings are taken from Python modules as RKD strongly rely on Python Packaging.

CallableTask

Package to import Single task to import PIP package to install Stable version
rkd.standardlib rkd.standardlib.CallableTask pip install rkd== SELECT VERSION https://badgen.net/pypi/v/rkd

This is actually not a task to use directly, it is a template of a task to implement yourself. It’s kind of a shortcut to create a task by defining a simple method as a callback.


import os
from rkd.syntax import TaskDeclaration
from rkd.standardlib import CallableTask
from rkd.contract import ExecutionContext


def union_method(context: ExecutionContext) -> bool:
    os.system('xdg-open https://iwa-ait.org')
    return True


IMPORTS = [
    TaskDeclaration(CallableTask(':create-union', union_method))
]

TASKS = []

:rkd:create-structure

Package to import Single task to import PIP package to install Stable version
rkd.standardlib rkd.standardlib.CreateStructureTask pip install rkd== SELECT VERSION https://badgen.net/pypi/v/rkd

Creates a template structure used by RKD in current directory.

:file:line-in-file

Package to import Single task to import PIP package to install Stable version
rkd.standardlib rkd.standardlib.LineInFileTask pip install rkd== SELECT VERSION https://badgen.net/pypi/v/rkd

Similar to the Ansible’s lineinfile, replaces/creates/deletes a line in file.

Example usage:

echo "Number: 10" > test.txt

rkd -rl debug :file:line-in-file test.txt --regexp="Number: ([0-9]+)?(.*)" --insert='Number: $match[0] / new: 10'
cat test.txt

rkd -rl debug :file:line-in-file test.txt --regexp="Number: ([0-9]+)?(.*)" --insert='Number: $match[0] / new: 6'
cat test.txt

rkd -rl debug :file:line-in-file test.txt --regexp="Number: ([0-9]+)?(.*)" --insert='Number: 50'
cat test.txt

rkd -rl debug :file:line-in-file test.txt --regexp="Number: ([0-9]+)?(.*)" --insert='Number: $match[0] / new: 90'
cat test.txt