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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
[[CMD]]
Name = 'Get Publish Branch First Commit for Cleaning'
Condition = [ 'all-all' ]
Type = 'command'
Location = '{{- .WorkingDir -}}'
Source = 'git rev-list --max-parents=0 --abbrev-commit HEAD'
Target = ''
Save = 'FirstCommitID'
SaveRegex = '(\w*)'
SaveStderr = true
ToSTDOUT = '{{- FirstCommitID -}}'
ToSTDERR = 'Completed obtaining first commit ID'

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: