Skip to content

Commit

Permalink
fix headless awx build
Browse files Browse the repository at this point in the history
by adding make target that create fake static file dir so collectstatic wont fail when building in headless mode
  • Loading branch information
TheRealHaoLiu committed Mar 23, 2023
1 parent 4bf8366 commit 6ed4b62
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,18 @@ ui-test-general:
$(NPM_BIN) run --prefix awx/ui pretest
$(NPM_BIN) run --prefix awx/ui/ test-general --runInBand

## Create empty ui/build for headless builds
ui-headless:
@echo "=== Creating empty awx/ui/build ==="
@rm -rf awx/ui/build/static
@mkdir -p awx/ui/build/static
@touch awx/ui/build/static/HEADLESS
@echo "=== Done creating empty awx/ui/build ==="

# NOTE: The make target ui-next is imported from awx/ui_next/Makefile
HEADLESS ?= no
ifeq ($(HEADLESS), yes)
dist/$(SDIST_TAR_FILE):
dist/$(SDIST_TAR_FILE): ui-headless ui-next/headless
else
dist/$(SDIST_TAR_FILE): $(UI_BUILD_FLAG_FILE) ui-next
endif
Expand Down
9 changes: 9 additions & 0 deletions awx/ui_next/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ UI_NEXT_GIT_BRANCH ?= main
## Default build target of ui-next Makefile, builds ui-next/build
ui-next: ui-next/build

.PHONY: ui-next/headless
## Create fake ui-next/build/awx for headless builds
ui-next/headless:
@echo "=== Creating fake $(UI_NEXT_DIR)/build/awx ==="
@rm -rf $(UI_NEXT_DIR)/build/awx
@mkdir -p $(UI_NEXT_DIR)/build/awx
@touch $(UI_NEXT_DIR)/build/awx/HEADLESS
@echo "=== Done creating fake $(UI_NEXT_DIR)/build/awx ==="

.PHONY: ui-next/build
## Build ui-next/build
ui-next/build: $(UI_NEXT_DIR)/build
Expand Down

0 comments on commit 6ed4b62

Please sign in to comment.