Release

Monteur provides Release CI Job to release your packages into their respective distribution stores.

The objective of the job is simple: to release newly made packages into their respective distribution stores.

All users has to do is to issue this command:

1
montuer release

Job Level Configurations

Montuer does facilitate a job-wide configurations file for configuring Release 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/release/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 Release 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 Release CI Job's recipe configuration files are stored in:

1
.configs/monteur/release/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
6
[Metadata]
Name = 'Reprepro'
Description = """
Monteur's .deb packagers released to hosting repository via Reprepro.
"""
Type = 'manual'
  • 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.

  • Type - select the built-in packager type for its corresponding release algorithm. For available built-in packager types, please refer to Packaging Meta Specification.

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
11
12
...

[Variables]
PackageType = 'deb-manual'
GPGID = '[email protected]'
GPGExistence = ''
Distribution = '' # to be filled later

[FMTVariables]
DataPath = '{{- .DataDir -}}/debian/reprepro'

...

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 = 'Reprepro'
Condition = 'all-all'
Type = 'command'
Command = 'reprepro'

[[Dependencies]]
Name = 'GPG Tool For Signing'
Condition = 'all-all'
Type = 'command'
Command = 'gpg'

...

Recipe's Release Meta Section

[Releases] are the list of packaged file data to be released by executing the [CMD] table onto each of the item. All these packages shall be iterated with the [CMD] table supplied with the given variables above.

Depending on Metadata.Type, either archive OR manual, Monteur will execute a preparation executions before executing the [CMD] for a package. This reduces the need to build large [CMD] commands list and promotes consistency.

An example is as follows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
[Releases]
Target = '{{- .ReleaseDir -}}/archives'
Checksum = 'sha512'

[Releases.Data]
Path = '{{- .RootDir -}}/docs/.data/releases/archives'
Format = 'toml'

[Releases.Packages.darwin-amd64]
OS = [ "darwin" ]
Arch = [ "amd64" ]
Source = '{{- .PackageDir -}}/targz/{{- .PkgName -}}-{{- .PkgVersion -}}-{{- .PkgOS -}}-{{- .PkgArch -}}.tar.gz'

...
  • [Releases]

    1. the table tag for the all the packages ready for release.

  • Target

    1. The directory path for housing the released data. This is used by local repository releases such as reprepro.

    2. This value shall be applied to all Releases.Packages without their Target value set.

  • Checksum

    1. Selecting checksum hasher.

    2. Supported hashers are: sha256 (default), sha512, or sha512->sha256.

  • [Releases.Data]

    1. Allows some releaser to spin its required data structure.

  • Releases.Data.Format

    1. The data file format for archive release type.

    2. Supported formats are: toml, txt, and csv.

  • Releases.Data.Path

    1. The directory path for housing the release data file.

    2. The filename will be a converted to filepath friendly app version (App.Version) value like v0.0.2 into v0-0-2.txt when set to be txt format.

  • [Releases.Packages]

    1. List of packages complying to Package Meta Processing Specification.

    2. Minimum MUST have 1 OS, 1 Arch, Source, and Target.

Recipe's Package Meta Section

The Monteur's Package Meta Processing features. All the recipe's releases and meta commands shall be executed horizontally across these packages repeatedly.

The data structure is complying to the Package Meta Processing Specification. Release CI Job requires you to at least define the following fields:

  • OS - define MINIMUM one operating system the package is for.

  • ARCH - define MINIMUM one CPU Architecture the package is for.

  • SOURCE - the full filepath of the package file.

  • TARGET - the directory/URL path for releasing the package.

An example would be:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
...

[Packages.linux-amd64]
OS = [ "linux" ]
Arch = [ "amd64" ]
Source = '{{- .PackageDir -}}/{{- .PackageType -}}/{{- .PkgName -}}_{{- .PkgVersionDigitLed -}}_{{- .PkgArch -}}.deb'
Target = '{{- .ReleaseDir -}}/deb'

[Packages.linux-arm64]
OS = [ "linux" ]
Arch = [ "arm64" ]
Source = '{{- .PackageDir -}}/{{- .PackageType -}}/{{- .PkgName -}}_{{- .PkgVersionDigitLed -}}_{{- .PkgArch -}}.deb'
Target = '{{- .ReleaseDir -}}/deb'

[Packages.linux-armhf]
OS = [ "linux" ]
Arch = [ "armhf" ]
Source = '{{- .PackageDir -}}/{{- .PackageType -}}/{{- .PkgName -}}_{{- .PkgVersionDigitLed -}}_{{- .PkgArch -}}.deb'
Target = '{{- .ReleaseDir -}}/deb'

...

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
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
...

[[CMD]]
Name = "Get GPG Secret Key for Verifications"
Type = 'command'
Condition = [ 'all-all' ]
Source = 'gpg --list-secret-keys "{{- .GPGID }}"'
Save = 'GPGExistence'

[[CMD]]
Name = "Verify GPG Secret Key Must Exists For Signing"
Type = 'is-not-empty'
Condition = [ 'all-all' ]
Source = '{{- .GPGExistence -}}'

[[CMD]]
Name = "Create Necessary Conf Data Directory"
Type = 'create-path'
Condition = [ 'all-all' ]
Source = '{{- .DataPath -}}/conf'

[[CMD]]
Name = 'Get Current Branch'
Type = 'command'
Condition = [ 'all-all' ]
Source = 'git branch --show-current'
Save = 'Distribution'

[[CMD]]
Name = "Verify Distribution is Not Empty"
Type = 'is-not-empty'
Condition = [ 'all-all' ]
Source = '{{- .Distribution -}}'

[[CMD]]
Name = "Release Using Reprepro"
Type = 'command'
Condition = [ 'all-all' ]
Source = """reprepro --basedir {{ .DataPath }} \
--outdir {{ .Target }} \
includedeb main \
{{ .Source }}
"""

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: