chore(e2e): Add source override to admin ui build script
* override build source for automation. Allowing enterprise builds from boundary-ui source
This commit is contained in:
1 parent
725093f8d8
commit
f7a52473b0
7 files changed
+48
-18
No files matched your search
+13
-4
@@ -14,8 +14,17 @@ if [ -z "$UI_VERSION_FILE" ]; then
|
||||
fi
|
||||
|
||||
UI_EDITION=$(make --no-print-directory edition)
|
||||
# allow override for the source of ui files
|
||||
# used by end-to-end tests to build enterprise edition from community files
|
||||
# UI_SRC_OVERRIDE will override which edition is pulled
|
||||
# but UI_EDITION_SRC will still determine the build version
|
||||
if [ -n "$UI_SRC_OVERRIDE" ]; then
|
||||
UI_SRC=$UI_SRC_OVERRIDE
|
||||
else
|
||||
UI_SRC=$UI_EDITION
|
||||
fi
|
||||
|
||||
if [ "$UI_EDITION" == "oss" ]; then
|
||||
if [ $UI_SRC == "oss" ]; then
|
||||
UI_REPO=https://github.com/hashicorp/boundary-ui
|
||||
REPO_NAME=boundary-ui
|
||||
else
|
||||
@@ -37,12 +46,12 @@ if which gh &> /dev/null; then
|
||||
echo "Found gh cli, attempting to download ui assets"
|
||||
|
||||
artifact_id=$(gh api "repos/hashicorp/${REPO_NAME}/actions/artifacts" --paginate | \
|
||||
jq ".artifacts[] | select(.workflow_run.head_sha == \"${UI_COMMITISH}f\" and .name == \"admin-ui-${UI_EDITION}\")" | \
|
||||
jq ".artifacts[] | select(.workflow_run.head_sha == \"${UI_COMMITISH}f\" and .name == \"admin-ui-${UI_SRC}\")" | \
|
||||
jq --slurp '.[0]' | \
|
||||
jq -r '.id')
|
||||
|
||||
if [[ "${artifact_id}" != "null" ]]; then
|
||||
echo "Downloading artifact: ${artifact_id} for admin-ui-${UI_EDITION} ${UI_COMMITISH}"
|
||||
echo "Downloading artifact: ${artifact_id} for admin-ui-${UI_SRC} ${UI_COMMITISH}"
|
||||
tmp_dir=$(mktemp -d)
|
||||
gh api "repos/hashicorp/${REPO_NAME}/actions/artifacts/${artifact_id}/zip" > "${tmp_dir}/boundary-ui.zip"
|
||||
trap 'rm -rf ${tmp_dir}' EXIT
|
||||
@@ -54,7 +63,7 @@ if which gh &> /dev/null; then
|
||||
unzip "${tmp_dir}/boundary-ui.zip" -d "${UI_CLONE_DIR}/ui/admin/dist"
|
||||
exit $?
|
||||
else
|
||||
echo "could not find artifact: admin-ui-${UI_EDITION} ${UI_COMMITISH}, falling back to git clone"
|
||||
echo "could not find artifact: admin-ui-${UI_SRC} ${UI_COMMITISH}, falling back to git clone"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user