diff --git a/tools/rapids-datetime-string b/tools/rapids-datetime-string new file mode 100755 index 0000000..129b40d --- /dev/null +++ b/tools/rapids-datetime-string @@ -0,0 +1,21 @@ +#!/bin/bash +# +# rapids-datetime-string +# +# Ensure the expected date-time environment variables used in +# package building are set. +# +# Example usage: +# +# source rapids-datetime-string +# +if [ "${CI:-false}" = "false" ]; then + # for local builds, just compute right here + RAPIDS_DATETIME_STRING="$(date -u +'%y%m%d%H%M%S')" + export RAPIDS_DATETIME_STRING +else + if [ -z "${RAPIDS_DATETIME_STRING:-}" ]; then + rapids-echo-stderr "Expected environment variable 'RAPIDS_DATETIME_STRING' to be set and non-empty." + exit 1 + fi +fi