feat: read built timestamp from git
All checks were successful
All checks were successful
This commit is contained in:
parent
097ebfaf38
commit
df0d831a06
3 changed files with 30 additions and 16 deletions
|
@ -1,6 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
set -eu;
|
||||
|
||||
##
|
||||
## workaround until we have a env `CI_COMMIT_TIMESTAMP`
|
||||
## see https://github.com/woodpecker-ci/woodpecker/issues/5245
|
||||
##
|
||||
|
||||
if [[ -z "${CI_COMMIT_TIMESTAMP:-}" ]]; then
|
||||
git config --global --add safe.directory "$PWD"
|
||||
CI_COMMIT_TIMESTAMP=$(git log -1 --format="%at")
|
||||
fi
|
||||
|
||||
##
|
||||
## check input
|
||||
##
|
||||
|
@ -27,7 +37,7 @@ if [[ "$BUILDCTL_FRONTEND" != "dockerfile.v0" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
SOURCE_DATE_EPOCH=${PLUGIN_SOURCE_DATE_EPOCH:-0}
|
||||
SOURCE_DATE_EPOCH=${PLUGIN_SOURCE_DATE_EPOCH:-${CI_COMMIT_TIMESTAMP:-0}}
|
||||
|
||||
if [[ -n "${PLUGIN_AUTH:-}" ]]; then
|
||||
echo "$PLUGIN_AUTH" | jq -r 'to_entries|map({(.key):{"auth":(.value.username+":"+.value.password)|@base64}})|add|{"auths":.}' > "$HOME/.docker/config.json"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue