mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #59623 from ixdy/bazel-source-date-epoch
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. bazel: support using SOURCE_DATE_EPOCH to override date **What this PR does / why we need it**: ports #48708 to apply to the bazel build as well. Note that bazel already sets `BUILD_TIMESTAMP` using `SOURCE_DATE_EPOCH`, but we have our own timestamp variable, so we need to fix it too. We could combine this with something like ```shell SOURCE_DATE_EPOCH=$(git log -1 --format=%cd --date=format:%s) ``` to get closer to repeatable builds. (This uses the timestamp from the last git commit.) **Release note**: ```release-note NONE ``` /assign @BenTheElder @mikedanese
This commit is contained in:
commit
05944b1d2c
@ -43,5 +43,7 @@ gitTreeState ${KUBE_GIT_TREE_STATE-}
|
|||||||
gitVersion ${KUBE_GIT_VERSION-}
|
gitVersion ${KUBE_GIT_VERSION-}
|
||||||
gitMajor ${KUBE_GIT_MAJOR-}
|
gitMajor ${KUBE_GIT_MAJOR-}
|
||||||
gitMinor ${KUBE_GIT_MINOR-}
|
gitMinor ${KUBE_GIT_MINOR-}
|
||||||
buildDate $(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
buildDate $(date \
|
||||||
|
${SOURCE_DATE_EPOCH:+"--date=@${SOURCE_DATE_EPOCH}"} \
|
||||||
|
-u +'%Y-%m-%dT%H:%M:%SZ')
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user