From 4df2d9f89185ba0b6838a5c6e0a41b71fd430006 Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Mon, 14 Oct 2024 08:23:28 +0200 Subject: [PATCH] adjust image names for gitlab --- .../devops/stacks/{{ cookiecutter.hostname }}.yml | 8 ++++---- .../{{ cookiecutter.__folder_name }}/backend/Makefile | 9 ++++++++- .../{{ cookiecutter.__folder_name }}/frontend/Makefile | 4 ++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/project/{{ cookiecutter.__folder_name }}/devops/stacks/{{ cookiecutter.hostname }}.yml b/project/{{ cookiecutter.__folder_name }}/devops/stacks/{{ cookiecutter.hostname }}.yml index 84eb7da..0433eb8 100644 --- a/project/{{ cookiecutter.__folder_name }}/devops/stacks/{{ cookiecutter.hostname }}.yml +++ b/project/{{ cookiecutter.__folder_name }}/devops/stacks/{{ cookiecutter.hostname }}.yml @@ -100,9 +100,9 @@ services: varnish: {%- if cookiecutter.devops_gitlab_deploy %} image: {{ cookiecutter.__container_image_prefix }}/varnish:${STACK_PARAM:-latest} - {% else %} + {%- else %} image: {{ cookiecutter.__container_image_prefix }}-varnish:${STACK_PARAM:-latest} - {% endif %} + {%- endif %} command: - '-p' - 'nuke_limit=2000' @@ -140,9 +140,9 @@ services: frontend: {%- if cookiecutter.devops_gitlab_deploy %} image: {{ cookiecutter.__container_image_prefix }}/frontend:${STACK_PARAM:-latest} - {% else %} + {%- else %} image: {{ cookiecutter.__container_image_prefix }}-frontend:${STACK_PARAM:-latest} - {% endif %} + {%- endif %} environment: RAZZLE_INTERNAL_API_PATH: http://backend:8080/Plone RAZZLE_API_PATH: https://{{ cookiecutter.hostname }} diff --git a/sub/project_settings/{{ cookiecutter.__folder_name }}/backend/Makefile b/sub/project_settings/{{ cookiecutter.__folder_name }}/backend/Makefile index 9c7112d..2aa9fa9 100644 --- a/sub/project_settings/{{ cookiecutter.__folder_name }}/backend/Makefile +++ b/sub/project_settings/{{ cookiecutter.__folder_name }}/backend/Makefile @@ -127,8 +127,11 @@ test-coverage: $(BIN_FOLDER)/tox ## run tests with coverage # Build Docker images .PHONY: build-image build-image: ## Build Docker Images + {%- if cookiecutter.devops_gitlab_deploy %} + @DOCKER_BUILDKIT=1 docker build . -t $(IMAGE_NAME_PREFIX)/backend:$(IMAGE_TAG) -f Dockerfile --build-arg PLONE_VERSION=$(PLONE_VERSION) + {%- else %} @DOCKER_BUILDKIT=1 docker build . -t $(IMAGE_NAME_PREFIX)-backend:$(IMAGE_TAG) -f Dockerfile --build-arg PLONE_VERSION=$(PLONE_VERSION) - + {%- endif %} # Acceptance tests .PHONY: acceptance-backend-start acceptance-backend-start: ## Start backend acceptance server @@ -136,4 +139,8 @@ acceptance-backend-start: ## Start backend acceptance server .PHONY: acceptance-image-build acceptance-image-build: ## Build Docker Images + {%- if cookiecutter.devops_gitlab_deploy %} + @DOCKER_BUILDKIT=1 docker build . -t $(IMAGE_NAME_PREFIX)/backend-acceptance:$(IMAGE_TAG) -f Dockerfile.acceptance --build-arg PLONE_VERSION=$(PLONE_VERSION) + {%- else %} @DOCKER_BUILDKIT=1 docker build . -t $(IMAGE_NAME_PREFIX)-backend-acceptance:$(IMAGE_TAG) -f Dockerfile.acceptance --build-arg PLONE_VERSION=$(PLONE_VERSION) + {%- endif %} diff --git a/sub/project_settings/{{ cookiecutter.__folder_name }}/frontend/Makefile b/sub/project_settings/{{ cookiecutter.__folder_name }}/frontend/Makefile index ea9c168..b272c2a 100644 --- a/sub/project_settings/{{ cookiecutter.__folder_name }}/frontend/Makefile +++ b/sub/project_settings/{{ cookiecutter.__folder_name }}/frontend/Makefile @@ -24,7 +24,11 @@ DOCKER_IMAGE=plone/server-dev:${PLONE_VERSION} DOCKER_IMAGE_ACCEPTANCE=plone/server-acceptance:${PLONE_VERSION} ADDON_NAME='{{ cookiecutter.__npm_package_name }}' +{%- if cookiecutter.devops_gitlab_deploy %} +IMAGE_NAME={{cookiecutter.__container_image_prefix}}/frontend +{%- else %} IMAGE_NAME={{cookiecutter.__container_image_prefix}}-frontend +{%- endif %} IMAGE_TAG=latest VOLTO_VERSION = $(shell cat ./mrs.developer.json | python -c "import sys, json; print(json.load(sys.stdin)['core']['tag'])")