Clean

Monteur provides Clean CI Job to get the repository clean up nice and tidy.

The objective of the job is simple: to clean the repository all the way back to its original source-code only status in a flexible manner, at will.

All users has to do is to issue this command:

1
montuer clean

Job Level Configurations

Montuer does facilitate a job-wide configurations file for configuring Clean CI Job over all settings and supplying job-wide variables.

The configurations, by default, are stored in the data file located in:

1
.configs/monteur/clean/config.toml

The file MUST be strictly named config alongside with the following supported data format's file extension. Currently, Monteur offers the following supported formats, arranged in priority by sequences: The file structure of the recipe configuration file is detailed from top to bottom in the following sub-sections, in sequences.

Job Level Variables Section

The Monteur's Variables Processing features. All variables defined in this job-wide configuration file only visible to ALL Clean CI Job recipes. It is highly recommended to place all project-based variables data into this list for recipes consistency purposes.

An example of the job-level variables section consists of the following fields:

1
2
3
4
5
6
[Variables]
Version = '1.17.3'
BaseURL = 'https://golang.org/dl/'

[FMTVariables]
Command = 'go{{- .Version -}}'

Recipe Configuration File

All Clean CI Job's recipe configuration files are stored in:

1
.configs/monteur/clean/jobs/

These files can have any filename BUT MUST STRICTLY HAVE any of the the following supported file extensions based on its data format of your choice: The file structure of the recipe configuration file is detailed from top to bottom in the following sub-sections, in sequences, and in the recommended TOML format.

Recipe's Metadata Section

The recipe's metadata section consists of the following fields:

1
2
3
4
5
[Metadata]
Name = 'Clean Up Build Log Artifact'
Description = """
Clean up all artifacts for a job.
"""
  • Name - used for recipe identification, reporting, and referencing usage. Monteur recommends keeping it short, concise and without any weird symbols (e.g. space will be replaced by short dash (-)).

  • Description - mainly for logging and reporting purposes. Describe the details of the recipe.

Recipe's Variables Section

The Monteur's Variables Processing Specification features. All variables defined in this recipe's configuration file are visible ONLY to this recipe. It is highly recommended to abstract as much variables away from your command algorithm as possible so that your user only has to customize these tables and not messing with your algorithm.

The variables section consists of the following fields:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
...

[Variables]
Job = 'build'
MonteurPath = '.monteurFS'

[FMTVariables]
TargetDir = '{{- .RootDir -}}/{{- .MonteurPath -}}/log/{{- .Job -}}'

...

Recipe's Dependencies Checking Section

The Monteur's Dependencies Checking features. All 3rd-party dependencies are listed and checked here against the running operating system for ensuring consistent performances and executions of this recipe.

The data structure is compliant to Dependencies Checking Specification. Here is a sample for this recipe:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
...

[[Dependencies]]
Name = 'Hugo for documentation purposes'
Condition = 'all-all'
Type = 'command'
Command = 'hugo'

[[Dependencies]]
Name = 'Git for version control'
Condition = 'all-all'
Type = 'command'
Command = 'git'

...

Recipe's Commands Section

The list of executing commands complying to compliant to Commands Execution Unit (CEU) Specification. The commands are executed as instructed in the key recipe sections, usually either execute as per se after all meta processing OR being used to execute horizontally.

The data structure is entirely based on the Commands Execution Unit (CEU) Specification. An example of this recipe's commands section would be:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
...

[[CMD]]
Name = "Remove Target Directory"
Type = 'delete-recursive-quiet'
Condition = [ 'all-all' ]
Source = '{{- .Target -}}'

[[CMD]]
Name = "Create Target Directory"
Type = 'create-path'
Condition = [ 'all-all' ]
Source = '{{- .Target -}}'

Currently, this is the last section of the recipe configuration file.

Known Recipes

Instead of working on all the recipes from scratch, Monteur does maintain a number of existing and continuously improved recipes to kick-start your compatible deployment. Here are the available recipes: