From 8d47644659a8625d00a0f277e591faa6bf3b2ca1 Mon Sep 17 00:00:00 2001 From: Hao Liu Date: Mon, 20 Mar 2023 12:25:28 -0400 Subject: [PATCH] Move placeholder index_awx.html out of build dir - move placeholder index_awx.html out of ui_next build dir - copy index_awx.html to build dir during development bootstrap if UI_NEXT has not been build --- awx/ui_next/Makefile | 1 + .../awx/index_awx.html => placeholder_index_awx.html} | 0 tools/docker-compose/bootstrap_development.sh | 7 ++++++- 3 files changed, 7 insertions(+), 1 deletion(-) rename awx/ui_next/{build/awx/index_awx.html => placeholder_index_awx.html} (100%) diff --git a/awx/ui_next/Makefile b/awx/ui_next/Makefile index bcbaf0f623..8506a12204 100644 --- a/awx/ui_next/Makefile +++ b/awx/ui_next/Makefile @@ -36,6 +36,7 @@ $(UI_NEXT_DIR)/src/build: ui-next/src ui-next/src/webpack .PHONY: ui-next/src ui-next/src: $(UI_NEXT_DIR)/src +# TODO: Rewrite this big bash script in a more readable way. .PHONY: $(UI_NEXT_DIR)/src ## Real target for ui-next/src. $(UI_NEXT_DIR)/src: diff --git a/awx/ui_next/build/awx/index_awx.html b/awx/ui_next/placeholder_index_awx.html similarity index 100% rename from awx/ui_next/build/awx/index_awx.html rename to awx/ui_next/placeholder_index_awx.html diff --git a/tools/docker-compose/bootstrap_development.sh b/tools/docker-compose/bootstrap_development.sh index c049beeb23..87c3f81ee7 100755 --- a/tools/docker-compose/bootstrap_development.sh +++ b/tools/docker-compose/bootstrap_development.sh @@ -25,7 +25,12 @@ fi # Make sure that the UI static file directory exists, Django complains otherwise. mkdir -p /awx_devel/awx/ui/build/static -mkdir -p /awx_devel/awx/ui_next/build/awx + +# Make sure that the UI_NEXT statifc file directory exists, if UI_NEXT is not built yet put a placeholder file in it. +if [ ! -d "/awx_devel/awx/ui_next/build/awx" ]; then + mkdir -p /awx_devel/awx/ui_next/build/awx + cp /awx_devel/awx/ui_next/placeholder_index_awx.html /awx_devel/awx/ui_next/build/awx/index_awx.html +fi if output=$(awx-manage createsuperuser --noinput --username=admin --email=admin@localhost 2> /dev/null); then echo $output