mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-08-18 13:16:08 +00:00
show full git SHA in ark version output
Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ fi
|
||||
|
||||
export CGO_ENABLED=0
|
||||
|
||||
GIT_SHA=$(git describe --tags --always)
|
||||
GIT_SHA=$(git rev-parse HEAD)
|
||||
GIT_DIRTY=$(git status --porcelain 2> /dev/null)
|
||||
if [[ -z "${GIT_DIRTY}" ]]; then
|
||||
GIT_TREE_STATE=clean
|
||||
|
||||
@@ -29,8 +29,6 @@ if [ -z "${RELEASE_NOTES_FILE}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export GIT_SHA=$(git describe --tags --always)
|
||||
|
||||
GIT_DIRTY=$(git status --porcelain 2> /dev/null)
|
||||
if [[ -z "${GIT_DIRTY}" ]]; then
|
||||
export GIT_TREE_STATE=clean
|
||||
|
||||
@@ -18,19 +18,20 @@ set -o nounset
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
||||
GIT_TAG=$(git describe --tags --always)
|
||||
|
||||
# this script copies all of the files under examples/ into a new directory,
|
||||
# config/ (which is gitignored so it doesn't result in the git
|
||||
# state being dirty, which would prevent goreleaser from running), and then
|
||||
# updates all of the image tags in those files to use $GIT_SHA (which will
|
||||
# be the release/tag name).
|
||||
# config/ (which is gitignored so it doesn't result in the git state being
|
||||
# dirty, which would prevent goreleaser from running), and then updates all
|
||||
# of the image tags in those files to use $GIT_TAG.
|
||||
|
||||
rm -rf config/ && cp -r examples/ config/
|
||||
|
||||
# the "-i'.bak'" flag to sed is necessary, with no space between the flag
|
||||
# and the value, for this to be compatible across BSD/OSX sed and GNU sed.
|
||||
# remove the ".bak" files afterwards (they're copies of the originals).
|
||||
find config/ -type f -name "*.yaml" | xargs sed -i'.bak' "s|gcr.io/heptio-images/ark:latest|gcr.io/heptio-images/ark:$GIT_SHA|g"
|
||||
find config/ -type f -name "*.yaml" | xargs sed -i'.bak' "s|gcr.io/heptio-images/ark:latest|gcr.io/heptio-images/ark:$GIT_TAG|g"
|
||||
find config/ -type f -name "*.bak" | xargs rm
|
||||
|
||||
find config/ -type f -name "*.yaml" | xargs sed -i'.bak' "s|gcr.io/heptio-images/fsfreeze-pause:latest|gcr.io/heptio-images/fsfreeze-pause:$GIT_SHA|g"
|
||||
find config/ -type f -name "*.yaml" | xargs sed -i'.bak' "s|gcr.io/heptio-images/fsfreeze-pause:latest|gcr.io/heptio-images/fsfreeze-pause:$GIT_TAG|g"
|
||||
find config/ -type f -name "*.bak" | xargs rm
|
||||
|
||||
Reference in New Issue
Block a user