mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-27 00:19:36 -05:00
c3c0940adb
* bazel: add configuration for remote caching * ci: enable bazel remote caching for building binaries * ci: use bazel directly when building go binaries * ci: enable cache for most build steps * dev-docs: document remote caching
30 lines
987 B
Bash
Executable File
30 lines
987 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
shopt -s inherit_errexit
|
|
|
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
|
|
REPOSITORY_ROOT="${REPOSITORY_ROOT:-$(cd "${SCRIPT_DIR}" && git rev-parse --show-toplevel)}"
|
|
|
|
ensure_pseudo_version_tool() {
|
|
if [[ ! -f "${REPOSITORY_ROOT}/tools/pseudo-version" ]]; then
|
|
go build -o "${REPOSITORY_ROOT}/tools/pseudo-version" "${REPOSITORY_ROOT}"/hack/pseudo-version >&2
|
|
fi
|
|
}
|
|
|
|
pseudo_version() {
|
|
ensure_pseudo_version_tool
|
|
"${REPOSITORY_ROOT}/tools/pseudo-version" -skip-v
|
|
}
|
|
|
|
timestamp() {
|
|
ensure_pseudo_version_tool
|
|
"${REPOSITORY_ROOT}/tools/pseudo-version" -print-timestamp -timestamp-format '2006-01-02T15:04:05Z07:00'
|
|
}
|
|
|
|
echo "REPO_URL https://github.com/edgelesssys/constellation.git"
|
|
echo "STABLE_STAMP_COMMIT $(git rev-parse HEAD)"
|
|
echo "STABLE_STAMP_STATE $(git diff-index --quiet HEAD -- && echo "clean" || echo "dirty")"
|
|
echo "STABLE_STAMP_VERSION $(pseudo_version)"
|
|
echo "STABLE_STAMP_TIME $(timestamp)"
|