From 93651a26a9b29962672a4dcfd1821b879e8128f9 Mon Sep 17 00:00:00 2001
From: Andy Postnikov <apostnikov@gmail.com>
Date: Sun, 20 Apr 2025 19:35:47 +0200
Subject: [PATCH] CI: push ubuntu variants for php-8.(1|2)-apache

---
 build_containers.sh       | 13 ++++++++-----
 php/8.1-apache/Dockerfile |  2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/build_containers.sh b/build_containers.sh
index 602cd93..9fb0deb 100755
--- a/build_containers.sh
+++ b/build_containers.sh
@@ -19,11 +19,14 @@ if [[ ! -z "${DOCKERFILES-}" ]]; then
       BUILDRESULT=$?
       if [ ${BUILDRESULT} -eq 0 ]; then
           docker push ${REGISTRY_PATH}/${DOCKERTAG#db-}:${GITBRANCH}
-          #TODO: this currently assumes that the only containers we are working on are the php containers.
-          # Legacy from when this was a Jenkins script
-          #if [ "${GITBRANCH}" != "production" ]; then
-          #  curl https://dispatcher.drupalci.org/job/drupalci_test_containers/buildWithParameters?token=${2}\&DCI_PHPVersion=${DOCKERTAG}:${GITBRANCH}
-          #fi
+
+          # Check if we're building 8.1-apache or 8.2-apache images
+          if [[ "${DOCKERTAG}" == "php-8.1-apache" || "${DOCKERTAG}" == "php-8.2-apache" ]]; then
+              # Tag and push with -ubuntu suffix
+              docker tag ${REGISTRY_PATH}/${DOCKERTAG}:${GITBRANCH} \
+                        ${REGISTRY_PATH}/${DOCKERTAG}-ubuntu:${GITBRANCH}
+              docker push ${REGISTRY_PATH}/${DOCKERTAG}-ubuntu:${GITBRANCH}
+          fi
       fi
     done
 fi
diff --git a/php/8.1-apache/Dockerfile b/php/8.1-apache/Dockerfile
index 4cdc68a..ebde08a 100644
--- a/php/8.1-apache/Dockerfile
+++ b/php/8.1-apache/Dockerfile
@@ -8,7 +8,7 @@ ARG PHP_CFLAGS="-O2 -g"
 FROM ${THE_BASE_IMAGE} as builder
 ENV DRUPALCI=TRUE TERM=xterm DEBIAN_FRONTEND=noninteractive
 
-#########
+########
 # Php build
 ######
 
-- 
GitLab