mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Display Git commit ID in output of odo commands where the version is shown (#7074)
* Display Git commit ID in output of odo commands where the version is displayed This covers: - odo init - odo dev - odo deploy Displaying the commit ID (same as in `odo version`) will help quickly pinpoint the exact commit without having to run `odo version`. See #6131 for more context * Append the state of the working tree next to the Git commit ID `git describe` is much more helpful to quickly understand the state of the working tree. For backward compatibility, we are defaulting to `git rev-parse`, just in case `git describe` does not work correctly. * Fix integration tests * Fix doc automation tests Strip the Git commit ID from the full odo version string prior to comparing the outputs. We still want to compare the tag displayed.
This commit is contained in:
@@ -8,7 +8,7 @@ echo "Reading ODO_VERSION, ODO_RELEASE and GIT_COMMIT env, if they are set"
|
||||
export ODO_VERSION=${ODO_VERSION:=3.14.0}
|
||||
export ODO_RELEASE=${ODO_RELEASE:=1}
|
||||
|
||||
export GIT_COMMIT=${GIT_COMMIT:=$(git rev-parse --short HEAD 2>/dev/null)}
|
||||
export GIT_COMMIT=${GIT_COMMIT:=$(git describe --no-match --always --abbrev=9 --dirty --broken 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)}
|
||||
|
||||
ODO_RPM_VERSION=$(echo $ODO_VERSION | tr '-' '~')
|
||||
export ODO_RPM_VERSION
|
||||
|
||||
Reference in New Issue
Block a user