From 6330f3aed7619539e3faa98e1e2a724c7498a069 Mon Sep 17 00:00:00 2001 From: bernhard Date: Mon, 29 Jul 2024 13:23:29 +0200 Subject: [PATCH] Issue #3628: support the target otobo-web because dedicated targes are needed in new version of OTOBO --- .github/workflows/docker_image_builder.yml | 2 ++ hooks/build | 9 +++++++++ otobo.web.dockerfile | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_image_builder.yml b/.github/workflows/docker_image_builder.yml index b6a2502102..ad4a278816 100644 --- a/.github/workflows/docker_image_builder.yml +++ b/.github/workflows/docker_image_builder.yml @@ -65,6 +65,7 @@ jobs: GIT_BRANCH=${{ env.otobo_branch }} GIT_COMMIT=${{ env.otobo_commit }} tags: ${{ env.otobo_ref }} + target: otobo-web cache-from: type=gha cache-to: type=gha,mode=max` @@ -100,5 +101,6 @@ jobs: GIT_BRANCH=${{ env.otobo_branch }} GIT_COMMIT=${{ env.otobo_commit }} tags: ${{ env.otobo_ref }} + target: otobo-web cache-from: type=gha cache-to: type=gha,mode=max` diff --git a/hooks/build b/hooks/build index f0764a53cd..bca7c51f67 100755 --- a/hooks/build +++ b/hooks/build @@ -17,7 +17,15 @@ #docker -v #printenv +# Specify the target in order to stay compatible with newer versions of OTOBO. +# In newer version different image are built with the same Dockerfile. +TARGET_OPTION=$(case $DOCKERFILE_PATH in + "otobo.web.dockerfile") echo "--target=otobo-web" ;; + *) echo "" ;; +esac) + # build the Docker image +# add the option '--progress plain' for seeing the printed output docker build\ --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')"\ --build-arg "DOCKER_TAG=$DOCKER_TAG"\ @@ -26,4 +34,5 @@ docker build\ --build-arg "GIT_REPO=$(git config --get remote.origin.url)"\ -f ./$BUILD_PATH/$DOCKERFILE_PATH\ -t $IMAGE_NAME\ + $TARGET_OPTION\ ./$BUILD_PATH diff --git a/otobo.web.dockerfile b/otobo.web.dockerfile index faf7033b32..5bd1ed36b3 100644 --- a/otobo.web.dockerfile +++ b/otobo.web.dockerfile @@ -11,7 +11,7 @@ # The Debian version is explicitly set to buster, that is Debian 10. # # The Perl module installer 'cpanm' is already installed. -FROM perl:5.32-buster +FROM perl:5.32-buster AS otobo-web # First there is some initial setup that needs to be done by root. USER root