Provide a simple and clear way for software to identify their version at build time (and preferably report it at runtime themselves).
It's currently dependant on a package.json to make some checks. This limitation could be easily removed.
This generate two files:
build.json looking like this:{
"version": "1.17.0-20180923-2004-174e781-test-sentry-cli",
"git_hash": "174e781",
"git_date": "20180923-2004",
"git_branch": "test/sentry-cli",
"build_date": "2018-09-29T21:42:11.091593"
}
version.txt looking like this:1.17.0-20180923-2004-174e781-test-sentry-cli
To test it locally, execute:
docker run --rm -v $(pwd):/work -ti habx/devops-build-infos
To use it with drone, add this line to the drone build file:
get-build-infos:
image: habx/devops-build-infos
Content type
Image
Digest
Size
43.7 MB
Last updated
over 6 years ago
docker pull habx/devops-build-infos