Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

RED can reference other scripts form the metadata at run-time, this Script Sourcing feature of RED is also available to be used in the Success and Failure Commands, this allows referencing a Host Script from the RED metadata rather than a script that already exists on the operating system.

In the following example command, I would have a python Host Script in the metadata named 'my_python_notify_script' which performs a notification based on two args, the job status and the email to notify. In the Success command I would pass an arg of 'success' and in the Failure command I can pass an arg of 'failed' so that the script can determine what the status is. The script itself will have access to the appropriate environment variables to construct a suitable email that informs of the failure or success.

Code Block
languageshell
titleScript Sourcing Command Example
python "WSL_SCRIPT_my_python_successnotify_script_CODE" "success" "job-admin@mydomain.com"

When a Success or Failure Command is triggered RED will do the following:

...