diff --git a/Makefile b/Makefile index 329f790259..3d5f119b6d 100644 --- a/Makefile +++ b/Makefile @@ -536,8 +536,10 @@ docker-compose-build: --cache-from=$(DEV_DOCKER_TAG_BASE)/awx_devel:$(COMPOSE_TAG) . docker-clean: - -$(foreach container_id,$(shell docker ps -f name=tools_awx -aq && docker ps -f name=tools_receptor -aq),docker stop $(container_id); docker rm -f $(container_id);) - -$(foreach image_id,$(shell docker images --filter=reference='*awx_devel*' -aq),docker rmi --force $(image_id);) + $(foreach container_id,$(shell docker ps -f name=tools_awx -aq && docker ps -f name=tools_receptor -aq),docker stop $(container_id); docker rm -f $(container_id);) + if [ "$(shell docker images | grep awx_devel)" ]; then \ + docker images | grep awx_devel | awk '{print $$3}' | xargs docker rmi --force; \ + fi docker-clean-volumes: docker-compose-clean docker-compose-container-group-clean docker volume rm -f tools_awx_db tools_grafana_storage tools_prometheus_storage $(docker volume ls --filter name=tools_redis_socket_ -q) @@ -571,7 +573,6 @@ VERSION: PYTHON_VERSION: @echo "$(PYTHON)" | sed 's:python::' -.PHONY: Dockerfile Dockerfile: tools/ansible/roles/dockerfile/templates/Dockerfile.j2 ansible-playbook tools/ansible/dockerfile.yml -e receptor_image=$(RECEPTOR_IMAGE) @@ -659,4 +660,4 @@ help/%: ## Display help for a specific target folder help/%/aliases: - @make -s help/all MAKEFILE_LIST="$*/Makefile.aliases" \ No newline at end of file + @make -s help/all MAKEFILE_LIST="$*/Makefile.aliases" diff --git a/awx/ui_next/Makefile b/awx/ui_next/Makefile index 3927034460..368f8a795e 100644 --- a/awx/ui_next/Makefile +++ b/awx/ui_next/Makefile @@ -14,6 +14,11 @@ UI_NEXT_GIT_REPO_SSH ?= git@github.com:ansible/ansible-ui.git UI_NEXT_GIT_REPO_HTTPS ?= https://github.com/ansible/ansible-ui.git UI_NEXT_GIT_BRANCH ?= main +# awx-manage collect static require the awx/ui_next/build to exist +# therefore we have to commit the build directory to source control +# so that make docker-compose will be able to start up uwsgi +# UI_NEXT_BUILT_FILE is here so that we can use it as the non-phony build target +UI_NEXT_BUILT_FILE = $(UI_NEXT_DIR).ui-built .PHONY: ui_next/clone-https ## Shallow clone the ui_next repo via https skip if UI_NEXT_GIT_REPO_HTTPS is undefined @@ -72,30 +77,37 @@ ui_next/src/build: ui_next/src ## Copy ui_next/src/build to ui_next/build ui_next/build: ui_next/src/build cp -r $(UI_NEXT_SRC_DIR)/build $(UI_NEXT_BUILD_DIR) + touch $(UI_NEXT_BUILT_FILE) -## Alias for ui_next/build, will not run if build already exist +## non PHONY target for ui_next/build. Will not run if build already exist +$(UI_NEXT_BUILT_FILE): + $(MAKE) ui_next/build + +## Alias for ui_next/build. +.PHONY: $(UI_NEXT_BUILD_DIR) $(UI_NEXT_BUILD_DIR): $(MAKE) ui_next/build ## Alias for ui_next/clean $(UI_NEXT_DIR)clean: - rm -rf $(UI_NEXT_DIR)/src - rm -rf $(UI_NEXT_DIR)/build + rm -rf $(UI_NEXT_SRC_DIR) + rm -rf $(UI_NEXT_BUILD_DIR) .PHONY: ui_next/clean ## Clean ui_next ui_next/clean: ui_next/clean/build - rm -rf $(UI_NEXT_DIR)/src + rm -rf $(UI_NEXT_SRC_DIR) .PHONY: ui_next/clean/src ## Clean ui_next src ui_next/clean/src: - rm -rf $(UI_NEXT_DIR)/src + rm -rf $(UI_NEXT_SRC_DIR) .PHONY: ui_next/clean/build ## Clean ui_next build ui_next/clean/build: - rm -rf $(UI_NEXT_DIR)/build + rm -rf $(UI_NEXT_BUILD_DIR) + rm -rf $(UI_NEXT_BUILT_FILE) print-%: @echo $($*) \ No newline at end of file