mirror of https://github.com/hashicorp/boundary
make update-ui-version (#578)
* make update-ui-version * make update-ui-version: default branch main * make update-ui-version: actually checkout commitpull/581/head
parent
f24e478542
commit
560c727bcf
@ -1,2 +1,4 @@
|
|||||||
31f7b575a981f92629dfe1ba8006054ae8b22eff Merge pull request #311 from hashicorp/release
|
31f7b575a981f92629dfe1ba8006054ae8b22eff Merge pull request #311 from hashicorp/release
|
||||||
# Above commit is used for production builds.
|
# This file determines the version of the UI to embed in the boundary binary.
|
||||||
|
# Update this file by running 'make update-ui-version' from the root of this repo.
|
||||||
|
# Set UI_COMMITISH when running the above target to update to a specific version.
|
||||||
|
|||||||
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -z "$UI_COMMITISH" ]; then
|
||||||
|
echo "Must set UI_COMMITISH"; exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$UI_CLONE_DIR" ]; then
|
||||||
|
echo "Must set UI_CLONE_DIR"; exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$UI_VERSION_FILE" ]; then
|
||||||
|
echo "Must set UI_CLONE_DIR"; exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
tempdir="$(dirname "${UI_CLONE_DIR}")"
|
||||||
|
|
||||||
|
mkdir -p "${tempdir}"
|
||||||
|
echo "*" > "${tempdir}/.gitignore"
|
||||||
|
|
||||||
|
if ! [ -d "${UI_CLONE_DIR}/.git" ]; then
|
||||||
|
git clone https://github.com/hashicorp/boundary-ui "${UI_CLONE_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "${UI_CLONE_DIR}"
|
||||||
|
git reset --hard
|
||||||
|
git fetch origin "${UI_COMMITISH}"
|
||||||
|
git checkout "${UI_COMMITISH}"
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -z "$UI_VERSION_FILE" ]; then
|
||||||
|
echo "Must set UI_VERSION_FILE"; exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$UI_CLONE_DIR" ]; then
|
||||||
|
echo "Must set UI_CLONE_DIR"; exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
shafileabs="$(pwd)/${UI_VERSION_FILE}"
|
||||||
|
cd "${UI_CLONE_DIR}"
|
||||||
|
V="$(git log -n1 --pretty=oneline)"
|
||||||
|
echo "==> Setting UI version to: $V"
|
||||||
|
|
||||||
|
# Write the version file.
|
||||||
|
{
|
||||||
|
echo "$V"
|
||||||
|
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}"
|
||||||
Loading…
Reference in new issue