2022-05-12 09:32:39 -05:00
|
|
|
#!/usr/bin/env bash
|
2026-04-06 15:48:37 +05:30
|
|
|
# Copyright IBM Corp. 2020, 2026
|
2020-10-08 18:51:53 +01:00
|
|
|
# SPDX-License-Identifier: BUSL-1.1
|
2023-02-02 17:15:17 -08:00
|
|
|
|
2020-10-08 18:51:53 +01:00
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
if [ -z "$UI_VERSION_FILE" ]; then
|
|
|
|
|
echo "Must set UI_VERSION_FILE"; exit 1
|
|
|
|
|
fi
|
2023-02-27 10:25:16 -05:00
|
|
|
|
2022-05-12 09:32:39 -05:00
|
|
|
if [ -z "$UI_COMMITISH" ]; then
|
|
|
|
|
echo "Must set UI_COMMITISH"; exit 1
|
2020-10-08 18:51:53 +01:00
|
|
|
fi
|
|
|
|
|
|
2026-10-12 12:44:26 -07:00
|
|
|
# Threshold ships a single (community) edition of the admin UI, built from the
|
|
|
|
|
# CyberCoveLLC/threshold-ui fork of hashicorp/boundary-ui.
|
|
|
|
|
UI_REPO=${UI_REPO:-https://repo.anhonesthost.net/CyberCoveLLC/threshold-ui.git}
|
2023-02-27 10:25:16 -05:00
|
|
|
|
2020-10-08 18:51:53 +01:00
|
|
|
shafileabs="$(pwd)/${UI_VERSION_FILE}"
|
2023-02-27 10:25:16 -05:00
|
|
|
V="$(git ls-remote ${UI_REPO} ${UI_COMMITISH})"
|
2022-05-12 09:32:39 -05:00
|
|
|
|
|
|
|
|
if [ -z "$V" ]; then
|
|
|
|
|
V=$UI_COMMITISH;
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
SHA=${V:0:40}
|
|
|
|
|
echo "==> Setting UI version to: $SHA"
|
2020-10-08 18:51:53 +01:00
|
|
|
|
|
|
|
|
# Write the version file.
|
|
|
|
|
{
|
2022-05-12 09:32:39 -05:00
|
|
|
echo "$SHA"
|
2020-10-08 18:51:53 +01:00
|
|
|
echo "# This file determines the version of the UI to embed in the boundary binary."
|
|
|
|
|
echo "# Update this file by running 'make update-ui-version' from the root of this repo."
|
|
|
|
|
echo "# Set UI_COMMITISH when running the above target to update to a specific version."
|
|
|
|
|
} > "${shafileabs}"
|