Merge pull request #8514 from rifelpet/cloudbuild

Image Pushing - Remove .git dependency from get_workspace_status.sh
This commit is contained in:
Kubernetes Prow Robot 2020-02-08 13:21:52 -08:00 committed by GitHub
commit f0dd2aeeab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 7 deletions

View File

@ -25,15 +25,11 @@
# and the output will be discarded.
# The code below presents an implementation that works for git repository
git_rev=$(git rev-parse HEAD)
if [[ $? != 0 ]];
then
exit 1
fi
git_rev=$(git rev-parse HEAD 2>/dev/null)
echo "BUILD_SCM_REVISION ${git_rev}"
# Check whether there are any uncommited changes
git diff-index --quiet HEAD --
git diff-index --quiet HEAD -- 2>/dev/null
if [[ $? == 0 ]];
then
tree_status="Clean"
@ -43,7 +39,7 @@ fi
echo "BUILD_SCM_STATUS ${tree_status}"
# Compute KOPS_VERSION. Keep in sync with logic in Makefile
GITSHA=$(git describe --always)
GITSHA=$(git describe --always 2>/dev/null)
# These variables need to match the values in our Makefile
# When we cut a new release we need to increment these accordingly