Commands Execution Unit (CEU)
Monteur supplies its own Commands Execution Unit (CEU) for cross-platform portability purposes. That way, the execution are consistent regardless of operating system.
Data Structure
Monteur's Commands Execution Unit uses a set of fields arranged
in a single array of instructions. The availability generally
depends on the CI Job. Currently, most CI Jobs do offer their
own single or parallel executions list of array.
The following data structure is the full CEU that you may or
may not need them for your recipe construction:
|
|
-
NameCOMPULSORY.
Maily used for identification, logging, and referencing purposes.
Available since Montuer Version
v0.0.1.
-
ConditionCOMPULSORY.
The list of supported Platform ID where the commands shall be executed when Monteur is opreating on the matching operating system.
Should
all-allis used, it will overwrite all platform ID for both specified and unspecified ones due to its alwaystruenature.Available since Montuer Version
v0.0.1.
-
TypeCOMPULSORY.
The Command Execution Instruction ID.
Available since Montuer Version
v0.0.1.
-
LocationOPTIONAL - include only if used.
The directory location for executing the command.
Monteur shall change into the specified directory location before executing the command. Once done, Monteur shall return back to the original directory for the next instruction.
Variables formatting is available for this field.
Available since Montuer Version
v0.0.1.
-
SourceCOMPULSORY/OPTIONAL - depends on the CEU
Type. Include only if used.Usually taken as the main input of the command. Please refer to the CEU instruction for their use definitions.
Variables formatting is available for this field.
Available since Montuer Version
v0.0.1.
-
TargetCOMPULSORY/OPTIONAL - depends on the CEU
Type. Include only if used.Usually taken as the secondary input or output of the command. Please refer to the CEU instruction for their use definitions.
Variables formatting is available for this field.
Available since Montuer Version
v0.0.1.
-
SaveOPTIONAL - include only if used.
The
Keyof the key-value field for saving theSTDOUTof an executed CEU into the runtime Variables list for later use.Variables formatting is available for this field.
Available since Montuer Version
v0.0.1.
-
SaveRegexOPTIONAL - include only if used.
REQUIRES -
Saveto be active and use.A regular expression filter to extract the wanted data using pattern recognitions like
(\w{1,}):(\s{1}).{1,}\((\d+.\d+%)\)ontotal: statement (50.0%)yieldstotal 50.0%when the CEU'sSaveis used. Otherwise, this field ignored.DO NOT include the regex slashes (e.g.
/ YOUR_REGEX /).Variables formatting is available for this field.
Available since Montuer Version
v0.0.1.
-
SaveStderrOPTIONAL - include only if used.
REQUIRES -
Saveto be active and use.ONLY ACCEPTS -
true;false;""(empty).Instructs Monteur to save from
STDERRoutput instead of the common and defaultSTDOUT.Available since Montuer Version
v0.0.1.
-
ToSTDOUTOPTIONAL - include only if used.
Dump the CEU output into
STDOUT. If the value is empty (e.g.""), no action will be taken.Variables formatting is available for this field.
Available since Montuer Version
v0.0.1.
-
ToSTDERROPTIONAL - include only if used.
Dump the CEU output into
STDERR. If the value is empty (e.g.""), no action will be taken.Variables formatting is available for this field.
Available since Montuer Version
v0.0.1.
Internal Working Mechanism
To make sure there is a common behavior for Monteur, this section shall defines the Command Execution Unit's way of working internally in a step-by-step manner. Please note that to keep things simple, these explainations are abstractive and are not the complete algorithm. For that, you have to refer to the source codes.
Step 0: Scan for Supported Commands
During the data file parsing, Monteur will check each
of the CEU commands are within its version's supporting
range via the CEU Type field. Should
any one (1) of them falls outside of the supporting
range, Monteur shall raise an error without executing
any of the commands.
Step 1: Process the Current Command
The CEU will process the current command from the list
of commands with the Variables Formatting
function.
Should there be any processing errors (e.g. syntax
error), Monteur shall raise that error and the chain
of comamnds is stopped.
Step 2: Executing the Current Command
The CEU will execute the current command as instructed
and have both STDOUT and
STDERR saved in its temporary memory for
the command's Save processing.
Should there be any processing errors (e.g. syntax
error), Monteur shall raise that error and the chain
of comamnds is stopped.
Step 3: Process Save data from Current Command
The CEU will now process the Save function
from STDOUT and STDERR from
the current command. Otherwise, the CEU shall skip this
step.
If Save is executed correctly, then the
variables list shall be updated accordingly for the next
command usage.
Should there be any processing errors (e.g. syntax
error), Monteur shall raise that error and the chain
of comamnds is stopped.
Step 4: Repeat Step 1 for Next Command
At this point, the current command is completed. The
next available command is then be executed by repeating
Step 1 onto it.
Should the list be exhausted, then Monteur will conclude
the chain of commands as completed.
Available Commands
Monteur shall continuously develop and add new commands from time to time. As of now, these are the currently available commands for your deployment: