From 2bdaf7ad561fa32486b2db8e828cf0184a4bdd1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Thu, 24 Oct 2024 15:22:28 +0200 Subject: [PATCH] remove unnecessary `CONFIGURATIONS` build arg --- deployment/src/docker/backend.Dockerfile | 10 ++++------ deployment/src/docker/maintenance.Dockerfile | 10 +++------- deployment/src/docker/webapp.Dockerfile | 14 ++++++-------- deployment/src/tools/merge-locales.sh | 12 ------------ docker-compose.branded.yml | 15 ++++++--------- 5 files changed, 19 insertions(+), 42 deletions(-) delete mode 100755 deployment/src/tools/merge-locales.sh diff --git a/deployment/src/docker/backend.Dockerfile b/deployment/src/docker/backend.Dockerfile index 84537cce2b..168f67d892 100644 --- a/deployment/src/docker/backend.Dockerfile +++ b/deployment/src/docker/backend.Dockerfile @@ -9,13 +9,11 @@ ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE} ################################################################################## FROM $APP_IMAGE_CODE AS code -ARG CONFIGURATION=example - # copy public constants and email templates into the Docker image to brand it -COPY configurations/${CONFIGURATION}/branding/constants/emails.ts src/config/ -COPY configurations/${CONFIGURATION}/branding/constants/logos.ts src/config/ -COPY configurations/${CONFIGURATION}/branding/constants/metadata.ts src/config/ -COPY configurations/${CONFIGURATION}/branding/email/ src/middleware/helpers/email/ +COPY ./branding/constants/emails.ts src/config/ +COPY ./branding/constants/logos.ts src/config/ +COPY ./branding/constants/metadata.ts src/config/ +COPY ./branding/email/ src/middleware/helpers/email/ ################################################################################## # BUILD ########################################################################## diff --git a/deployment/src/docker/maintenance.Dockerfile b/deployment/src/docker/maintenance.Dockerfile index d2fde349f1..6fecd15b2c 100644 --- a/deployment/src/docker/maintenance.Dockerfile +++ b/deployment/src/docker/maintenance.Dockerfile @@ -9,17 +9,13 @@ ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE} ################################################################################## FROM $APP_IMAGE_CODE AS code -ARG CONFIGURATION=example - # copy public constants into the Docker image to brand it -COPY configurations/${CONFIGURATION}/branding/static/ static/ -COPY configurations/${CONFIGURATION}/branding/constants/ constants/ +COPY ./branding/static/ static/ +COPY ./branding/constants/ constants/ RUN /bin/sh -c 'cd constants && for f in *.ts; do mv -- "$f" "${f%.ts}.js"; done' # locales -COPY configurations/${CONFIGURATION}/branding/locales/*.json locales/tmp/ -COPY src/tools/ tools/ -RUN apk add --no-cache bash jq +COPY ./branding/locales/*.json locales/tmp/ RUN tools/merge-locales.sh ################################################################################## diff --git a/deployment/src/docker/webapp.Dockerfile b/deployment/src/docker/webapp.Dockerfile index c5cc0e1df6..d4bd388a7a 100644 --- a/deployment/src/docker/webapp.Dockerfile +++ b/deployment/src/docker/webapp.Dockerfile @@ -9,18 +9,16 @@ ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE} ################################################################################## FROM $APP_IMAGE_CODE AS code -ARG CONFIGURATION=example - # copy public constants into the Docker image to brand it -COPY configurations/${CONFIGURATION}/branding/static/ static/ -COPY configurations/${CONFIGURATION}/branding/constants/ constants/ +COPY ./branding/static/ static/ +COPY ./branding/constants/ constants/ RUN /bin/sh -c 'cd constants && for f in *.ts; do mv -- "$f" "${f%.ts}.js"; done' -COPY configurations/${CONFIGURATION}/branding/locales/html/ locales/html/ -COPY configurations/${CONFIGURATION}/branding/assets/styles/imports/ assets/styles/imports/ -COPY configurations/${CONFIGURATION}/branding/assets/fonts/ assets/fonts/ +COPY ./branding/locales/html/ locales/html/ +COPY ./branding/assets/styles/imports/ assets/styles/imports/ +COPY ./branding/assets/fonts/ assets/fonts/ # locales -COPY configurations/${CONFIGURATION}/branding/locales/*.json locales/tmp/ +COPY ./branding/locales/*.json locales/tmp/ COPY src/tools/ tools/ RUN apk add --no-cache bash jq RUN tools/merge-locales.sh diff --git a/deployment/src/tools/merge-locales.sh b/deployment/src/tools/merge-locales.sh deleted file mode 100755 index 21d2632656..0000000000 --- a/deployment/src/tools/merge-locales.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -for locale in `ls locales/*.json`; -do - file=$(basename $locale); - if [ -f locales/tmp/$file ]; then - jq -s '.[0] * .[1]' $locale locales/tmp/$file > locales/tmp/tmp.json; - mv locales/tmp/tmp.json $locale; - fi; -done; - -rm -r locales/tmp/ diff --git a/docker-compose.branded.yml b/docker-compose.branded.yml index 3701d8f5df..aef04fc423 100644 --- a/docker-compose.branded.yml +++ b/docker-compose.branded.yml @@ -4,10 +4,9 @@ services: image: ${IMAGE_REPOSITORY:-ghcr.io/ocelot-social-community/stage.ocelot.social}/webapp build: target: branded - context: ./deployment - dockerfile: ./src/docker/webapp.Dockerfile + context: ${CONTEXT:-./deployment/configurations/stage.ocelot.social/} + dockerfile: ./docker/webapp.Dockerfile args: - CONFIGURATION: ${CONFIGURATION:-stage.ocelot.social} APP_IMAGE_TAG_CODE: ${OCELOT_VERSION:-latest}-code APP_IMAGE_TAG_BASE: ${OCELOT_VERSION:-latest}-base @@ -15,10 +14,9 @@ services: image: ${IMAGE_REPOSITORY:-ghcr.io/ocelot-social-community/stage.ocelot.social}/backend build: target: branded - context: ./deployment - dockerfile: ./src/docker/backend.Dockerfile + context: ${CONTEXT:-./deployment/configurations/stage.ocelot.social/} + dockerfile: ./docker/backend.Dockerfile args: - CONFIGURATION: ${CONFIGURATION:-stage.ocelot.social} APP_IMAGE_TAG_CODE: ${OCELOT_VERSION:-latest}-code APP_IMAGE_TAG_BASE: ${OCELOT_VERSION:-latest}-base @@ -26,9 +24,8 @@ services: image: ${IMAGE_REPOSITORY:-ghcr.io/ocelot-social-community/stage.ocelot.social}/maintenance build: target: branded - context: ./deployment - dockerfile: ./src/docker/maintenance.Dockerfile + context: ${CONTEXT:-./deployment/configurations/stage.ocelot.social/} + dockerfile: ./docker/maintenance.Dockerfile args: - CONFIGURATION: ${CONFIGURATION:-stage.ocelot.social} APP_IMAGE_TAG_CODE: ${OCELOT_VERSION:-latest}-code APP_IMAGE_TAG_BASE: ${OCELOT_VERSION:-latest}-base