From 9d1fc9f54a7346aa2a8d67d2e4fd633536277121 Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Mon, 10 Feb 2025 13:48:52 -0500 Subject: [PATCH 1/3] Publish image base on git repo name --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d0b12f62502c..d87b0f05d438 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ NODE ?= node NPM_BIN ?= npm KIND_BIN ?= $(shell which kind) CHROMIUM_BIN=/tmp/chrome-linux/chrome +GIT_REPO_NAME ?= $(shell basename `git rev-parse --show-toplevel`) GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD) MANAGEMENT_COMMAND ?= awx-manage VERSION ?= $(shell $(PYTHON) tools/scripts/scm_version.py 2> /dev/null) @@ -56,9 +57,9 @@ DEV_DOCKER_OWNER ?= ansible # Docker will only accept lowercase, so github names like Paul need to be paul DEV_DOCKER_OWNER_LOWER = $(shell echo $(DEV_DOCKER_OWNER) | tr A-Z a-z) DEV_DOCKER_TAG_BASE ?= ghcr.io/$(DEV_DOCKER_OWNER_LOWER) -DEVEL_IMAGE_NAME ?= $(DEV_DOCKER_TAG_BASE)/awx_devel:$(COMPOSE_TAG) -IMAGE_KUBE_DEV=$(DEV_DOCKER_TAG_BASE)/awx_kube_devel:$(COMPOSE_TAG) -IMAGE_KUBE=$(DEV_DOCKER_TAG_BASE)/awx:$(COMPOSE_TAG) +DEVEL_IMAGE_NAME ?= $(DEV_DOCKER_TAG_BASE)/$(GIT_REPO_NAME)_devel:$(COMPOSE_TAG) +IMAGE_KUBE_DEV=$(DEV_DOCKER_TAG_BASE)/$(GIT_REPO_NAME)_kube_devel:$(COMPOSE_TAG) +IMAGE_KUBE=$(DEV_DOCKER_TAG_BASE)/$(GIT_REPO_NAME):$(COMPOSE_TAG) # Common command to use for running ansible-playbook ANSIBLE_PLAYBOOK ?= ansible-playbook -e ansible_python_interpreter=$(PYTHON) From 4ec277114dcbc12b71ff487bcb5591f2fa6fdf45 Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:48:54 -0500 Subject: [PATCH 2/3] Update action.yml --- .github/actions/awx_devel_image/action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/awx_devel_image/action.yml b/.github/actions/awx_devel_image/action.yml index 4ad99f71debb..96c08a0970d4 100644 --- a/.github/actions/awx_devel_image/action.yml +++ b/.github/actions/awx_devel_image/action.yml @@ -24,7 +24,10 @@ runs: - name: Pre-pull latest devel image to warm cache shell: bash - run: docker pull -q ghcr.io/${OWNER_LC}/awx_devel:${{ github.base_ref || github.ref_name }} + run: | + DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER_LC} \ + COMPOSE_TAG=${{ github.base_ref }} \ + docker pull -q `make print-DEVEL_IMAGE_NAME` - name: Build image for current source checkout shell: bash From 4316ff485abdc9566bfec447d97510e549151c02 Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:53:32 -0500 Subject: [PATCH 3/3] Update action.yml --- .github/actions/awx_devel_image/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/awx_devel_image/action.yml b/.github/actions/awx_devel_image/action.yml index 96c08a0970d4..18bfde790c9d 100644 --- a/.github/actions/awx_devel_image/action.yml +++ b/.github/actions/awx_devel_image/action.yml @@ -26,7 +26,7 @@ runs: shell: bash run: | DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER_LC} \ - COMPOSE_TAG=${{ github.base_ref }} \ + COMPOSE_TAG=${{ github.base_ref || github.ref_name }} \ docker pull -q `make print-DEVEL_IMAGE_NAME` - name: Build image for current source checkout