mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-06-27 08:06:52 +00:00
Allow to override build date with SOURCE_DATE_EPOCH
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. This date call only works with GNU date. Also use UTC to be independent of timezone.
This commit is contained in:
parent
e4a8c9f639
commit
29df24fa6c
2
build
2
build
@ -19,7 +19,7 @@ if [ -z "$VERSION" ]; then
|
||||
fi
|
||||
set -e
|
||||
fi
|
||||
DATE=$(date --iso-8601=seconds)
|
||||
DATE=$(date -u -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}" --iso-8601=seconds)
|
||||
COMMIT=${COMMIT:-$(git rev-parse --verify HEAD)}
|
||||
LDFLAGS="-X main.version=${VERSION:-master} -X main.commit=${COMMIT} -X main.date=${DATE}"
|
||||
export CGO_ENABLED=0
|
||||
|
Loading…
Reference in New Issue
Block a user