Files
threshold/scripts/uiupdate.sh
T
Cameron Perera 20f5185a8c chore: Change how update-ui-version gets the latest commit sha (#2069)
* chore: Change how update-ui-version gets the latest commit sha on main

* remove changelog edits

* chore: refactor uiupdate.sh to use UI_COMMITISH instead of main
2022-05-12 09:32:39 -05:00

29 lines
725 B
Bash
Executable File

#!/usr/bin/env bash
set -e
if [ -z "$UI_VERSION_FILE" ]; then
echo "Must set UI_VERSION_FILE"; exit 1
fi
if [ -z "$UI_COMMITISH" ]; then
echo "Must set UI_COMMITISH"; exit 1
fi
shafileabs="$(pwd)/${UI_VERSION_FILE}"
V="$(git ls-remote https://github.com/hashicorp/boundary-ui ${UI_COMMITISH})"
if [ -z "$V" ]; then
V=$UI_COMMITISH;
fi
SHA=${V:0:40}
echo "==> Setting UI version to: $SHA"
# Write the version file.
{
echo "$SHA"
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}"