Skip to content

Commit

Permalink
Merge pull request kubevirt#1158 from rthallisey/build-version
Browse files Browse the repository at this point in the history
Default SOURCE_DATE_EPOCH to avoid using 'git'
  • Loading branch information
rmohr authored Jun 15, 2018
2 parents 1fd27b5 + 1c3c9a6 commit 5167d4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hack/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
# "dirty" indicates source code changes after the git commit id
# "archive" indicates the tree was produced by 'git archive'
# KUBEVIRT_GIT_VERSION - "vX.Y" used to indicate the last release version.
# KUBEVIRT_SOURCE_DATE_EPOCH - unix timestamp. Set to ' ' to generate using
# 'date' instead of 'git'.
#

# Grovels through git to set a set of env variables.

Expand Down Expand Up @@ -100,7 +103,7 @@ function kubevirt::version::ldflag() {
function kubevirt::version::ldflags() {
kubevirt::version::get_version_vars

SOURCE_DATE_EPOCH=$(git show -s --format=format:%ct HEAD)
SOURCE_DATE_EPOCH=${KUBEVIRT_SOURCE_DATE_EPOCH-$(git show -s --format=format:%ct HEAD)}

local buildDate
[[ -z ${SOURCE_DATE_EPOCH-} ]] || buildDate="--date=@${SOURCE_DATE_EPOCH}"
Expand Down

0 comments on commit 5167d4d

Please sign in to comment.