version Trait
Attributes
name |
required? |
default |
type |
explanation |
---|---|---|---|---|
preprocess |
no |
inject-commit-hash |
str |
sets the semver version operation to calculate the effective version during the build |
versionfile |
no |
VERSION |
str |
relative path to the version file |
inject_effective_version |
no |
False |
bool |
whether or not the effective version is to be written into the source tree’s VERSION file |
version_interface |
no |
|
VersionInterface |
how the version can be read/written. This is done automatically set to “callback”, if “read_callback” and “write_callback” are set. Only here for compatibility reasons. |
read_callback |
no |
None |
str |
relative path to an executable that returns current version via stdout |
write_callback |
no |
None |
str |
relative path to an executable that accepts version from stdin and writes it |
version_interface Enumeration Values
file
callback
Dependencies
This trait has no dependencies
Adds version handling for the pipeline’s main repository
. Implies that the
main repository
hosts a gardener component
.
During job execution, an effective version
is calculated and made available
via regular file ${VERSION_PATH}/version
or via environment variable EFFECTIVE_VERSION
.
Component versions must be valid SemVer versions.
preprocess
Attribute
value |
explanation |
---|---|
noop |
no change |
finalize |
remove suffix |
inject-commit-hash |
set version suffix to main repo’s head commit hash |
inject-commit-hash-nodash |
set version suffix to main repo’s head commit hash (w/o dash) |
inject-timestamp |
set version suffix to the POSIX timestamp |
inject-branch-name |
set version suffix to main repository’s branch name |
use-branch-name |
set version to branch name |