edgeXSemver
Overview
Shared library containing a useful set of functions to help with the creation of semantic versioning using the git-semver python library.
The main call function builds the git semver command based on the provided input.
Please note: this shared library is responsible for setting the VERSION environment variable during git semver init execution.
Parameters
| Name | Required | Type | Description and Default Value |
|---|---|---|---|
| command | false | str | Specify which git semver sub command to run. Example: init, bump, push |
| semverVersion | false | string | Force a specific override version instead of reading the version from the semver branch. Default: <empty string> |
| gitSemverVersion | false | string | What version of the git-semver docker image to use. Default: latest |
| credentials | false | string | Which Jenkins credential to use to authenticate to GitHub and push git tag. Default: edgex-jenkins-ssh |
Functions
edgeXSemver.executeGitSemver: Execute semverCommand via ssh with provided credentials.edgeXSemver.setGitSemverHeadTag: setGITSEMVER_HEAD_TAGto value ofHEADwhen any of the following conditions are satisfied:- An init version is specified and HEAD is tagged with init version.
- An init version is not specified and HEAD is tagged.
edgeXSemver.getCommitTags: Return list of all tags at a specific commit point.
Usage
Regular init
edgeXSemver('init')
Force specific the semver version to use.
edgeXSemver('init', '2.0.0')
Bump the semver version using default semver bump level (pre-release).
edgeXSemver('bump')