semantic version helper tool
Project description
semver-tool
Print SemVer version for a git project. Git tags must match v?M.N.P
pattern.
You can print specific version components using fotmat string.
Full format string is MNPRBD, where:
- M - major
- N - minor
- P - patch
- R - prerelease
- B - build
Usage
Examples:
$ semver-tool
4.1.2-rc.2+git.b10c717
$ semver-tool -f MNPR
4.1.2-rc.2
Use Cases
Build docker images
I use this tool to build docker images using SemVer schema. The flow is this:
- build
image:latest
withCommit
label - push it as
image:M.N.P-R
- push it as
image:M.N.P
- push it as
image:M.N
My build script has this code
current=$(semver_tool -f MNPR)
docker build --label Commit=$(semver_tool) -t image:$current
docker tag image:$current image $(semver_tool -f MNP)
docker tag image:$current image $(semver_tool -f MN)
which results in these images
image 1.2.3-rc.2
image 1.2.3
image 1.2
Each image has Commit
label with semver description, eg, 1.2.3-rc.2+git.22eeff
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for semver_tool-3.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5723c7deb65fbf43d20f613544f9d96d80a91816ffa27863b71cd5bee6fc1781 |
|
MD5 | f614e7e34830e4115995a57d7f6b6d59 |
|
BLAKE2b-256 | 2a94b2dbc35d42563a375b49e13f5d5089e6bbaf42b932d16cd7371d60a4a61b |