core.example_script_default#

cijoe example script#

The script is a modified “Hello, World!” example. It repeatedly prints a message a set number of times and allows parameterization of the message content.

The purpose of this script is to demonstrate how to run commands and supply input to the script using a configuration file, environment variables, command-line arguments and workflow step arguments.

An example of using the core infrastructure of cijoe:

  • cijoe.run(command)

    • Error-handling; checking return-code

    • Output processing state.output()

Input is given to scripts via configuration-files, environment variables and from workflow-step-arguments, this is demonstrated as the first thing in the script.

cijoe also has primitives for transferring data:

  • cijoe.get(src, dst)

    • Transfer ‘src’ directory or file from target to ‘dst’ on initiator

  • cijoe.put(src, dst)

    • Transfer ‘src’ directory or file from initiator to ‘dst’ on target

These are not used in the example code below, but you can experiment and try adding them yourself.

cijoe.core.scripts.example_script_default.add_args(parser: ArgumentParser)#

Optional function for defining command-line arguments for this script

cijoe.core.scripts.example_script_default.main(args: Namespace, cijoe: Cijoe)#

Entry-point of the cijoe-script

CLI arguments#

options:

  • -h, --help

    show this help message and exit

  • --repeat REPEAT

    Amount of times the message will be repeated