Allow to override build date

in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
This commit is contained in:
Bernhard M. Wiedemann 2017-07-19 06:17:19 +02:00
parent fa7db52e26
commit 760763e995
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ DEFAULT_BUNDLES=(
) )
VERSION=$(< ./VERSION) VERSION=$(< ./VERSION)
! BUILDTIME=$(date --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/') ! BUILDTIME=$(date -u -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}" --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/')
if [ "$DOCKER_GITCOMMIT" ]; then if [ "$DOCKER_GITCOMMIT" ]; then
GITCOMMIT="$DOCKER_GITCOMMIT" GITCOMMIT="$DOCKER_GITCOMMIT"
elif command -v git &> /dev/null && [ -d .git ] && git rev-parse &> /dev/null; then elif command -v git &> /dev/null && [ -d .git ] && git rev-parse &> /dev/null; then