Created
March 28, 2019 13:39
-
-
Save porfirion/d947f435d6764256f11a629b48060b8a to your computer and use it in GitHub Desktop.
Example of generation version.json file from git commit info to use in Jenkins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log -1 --pretty=format:' {"id": "%H", "id_short": "%h", "message": "%s", "author": "%aN", "date": "%aD", "comitter": "%cN", "commit_date": "%cD", ' \ | |
| (cat && printf '"build_date": "%s",' "$(date -R)") \ | |
| (cat && printf '"branch": "%s"' "${BRANCH}") \ | |
| (cat && printf '}') > version.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment