Versioning utilities
One of the most difficult tasks is to automatically and uniquely version command line utilities, especially when using a CI/CD system. This section presents a technique that uses a GitHub value to version a command line utility on your local machine. You can apply the same technique to GitLab—just search for the available GitLab variables and values and choose one that fits your needs.
This technique is used by both the docker
and kubectl
utilities, among others:
$ docker version
Client:
Version: 24.0.5
API version: 1.43
Go version: go1.20.6
Git commit: ced0996600
Built: Wed Jul 26 21:44:58 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.5
API version: 1.43 (minimum version 1.12)
Go version: go1.20.6
Git commit: a61e2b4c9c
Built: Wed Jul 26 21:44:58 2023
OS/Arch: linux/amd64
Experimental: ...