/gover

Primary LanguageGo

Gover

Author: Mitch Murphy
Date: 28 March 2023

gover gopher

Generated using Midjourney

Description

Very simple Golang project that simply parses a VERSION file, incorporates any predefined Gitlab CI/CD variables and returns the full version string.

Structure

VERSION

MAJOR=<major_version>
MINOR=<minor_version>
PATCH=<patch_version>
# Optional
ADDOPTS=<additional_options>

Usage

All relevant commands are listed and annotated in the Makefile.

This program is intended to run inside a CI/CD pipeline (in a container), but can also be run locally. Note that when running any pipeline in Gitlab, these variables are automatically added to any stage(kmage). Here are the commands:

./bin/gover version

Example output/versions:

# merge request to development branch
0.1.0-development+55358
0.1.1-development-alpha.1+55359
# merge request to rc/* branch
0.1.2-rc-8.2.0+55360
# merge request to release branch (official release)
v0.1.3

Note that with how MCS-COP versions software (ie. 8.1.0, 8.2.1, etc.) this directly conflicts with SemVer. This needs to be addresses.