Local System Sourcing Type

Montuer has a built-in local system sourcing method for its Setup Meta processing function. Here's its working mechanics and specifications.

Purpose

The purpose of facilitating this sourcing method type is for Monteur to source a 3rd-party software package for the repository via checking the local system command's availability solely using its built-in functionalities.

Data Structure

This function is specifically built into the Setup CI Job. Hence, its data structure is scattered across various parts and sections of the CI Job recipe. In this specification, all its settings are specified in each sub-sections by following the CI Job's recipe's data file from top to bottom.

Sourcing Method Type

To use this method type, simply set Metadata.Type to percisely local-system. This will instruct Monteur to use its internal command checking function for checking the availability of the 3rd-party tool or library.

Note that in certain terminal system (e.g. BASH) that offers aliases, Monteur will not be able to see them as they're specific to that terminal only.

Here is a code snippet of the recipe file:

1
2
3
[Metadata]
...
Type = 'local-system'

Recipe Sourcing Section

This sourcing method employs simple fields in the recipe sourcing section. Generally speaking, you want to define the common command via all-all Monteur Platform ID and then overwrite with the operating system specific data if needed.

Here is the recommended fields in its data structure for effective maintenance and readability usage:

1
2
3
[Sources.all-all]
Format = 'raw'
URL = 'git'
  • Sources.{OS}-{ARCH}

    1. COMPULSORY - This setting is used for uniquely grouping and structuring source data between multiple groups of data fields. It is also used for facilitating cross-platform supports like listing all the sources here instead of spinning multiple recipe files.

    2. The Monteur Platform ID for this sourcing data to be effective. Example: [Sources.all-all] and [Sources.linux-amd64].

    3. This field was added since Monteur version v0.0.1.

  • Sources.{OS}-{ARCH}.Format

    1. COMPULSORY - It is used to define the target file format.

    2. See Setup Meta Processing for supported algorithms.

    3. This field was added since Monteur version v0.0.1.

  • Sources.{OS}-{ARCH}.URL

    1. COMPULSORY - The location or the command of the target.

    2. Variables formatting is available for this field.

    3. This field was added since Monteur version v0.0.1.

User Startup Configurations

This sourcing method complies to the original Setup Meta Processing so nothing special is needed.

Here is an example for quick referencing only:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[Config]
linux = """
#!/bin/bash

_name="hugo"

case $1 in
--stop)
	;;
*)
	if [ ! -z "$(type -p "$_name")" ]; then
		1>&2 printf "[ DONE  ] '$_name' is available.\\n"
        else
		1>&2 printf "[ ERROR ] '$_name' is missing.\\n"
	fi
	;;
esac
"""
windows = """
...COMING SOON...
"""
darwin = """
...COMING SOON...
"""
...

Epilogue

That's all for local system sourcing type. If you have any question, please feel free to raise your question at our Issues Section.