From 33093fdd3b3e7132aee2519e65f5c990fbdf1e45 Mon Sep 17 00:00:00 2001
From: s j <sj@1729.be>
Date: Sun, 12 Jun 2022 11:33:55 +0200
Subject: [PATCH 1/5] imp: build fpm image

---
 .gitlab-ci.yml             |  5 ++++-
 docker/Dockerfile-old.tmpl | 21 +++++++++++++++++++++
 docker/Dockerfile.tmpl     | 22 ++++++++++++++++++----
 3 files changed, 43 insertions(+), 5 deletions(-)
 create mode 100644 docker/Dockerfile-old.tmpl

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e00d34a..bceafee 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -24,8 +24,11 @@ include:
   #   file: '/.gitlab-ci/.gitlab-ci-template.yml'
   # If hosted on an other Gitlab instance.
   # - remote: 'https://gitlab.com/mog33/gitlab-ci-drupal/-/raw/3.x-dev/.gitlab-ci/.gitlab-ci-template.yml'
-  - remote: 'https://git.startx.be/infra/drupal_docker/-/raw/master/.gitlab-ci-template.yml'
   - remote: 'https://git.startx.be/forks/gitlab-ci-drupal/-/raw/startx/.gitlab-ci/.gitlab-ci-template.yml'
+  - project: 'infra/gitlabci-docker'
+    ref: main
+    file: '/docker.template.yml'
+
 
 # If needed by your Gitlab-ci instance, you can set global tags for all jobs.
 # default:
diff --git a/docker/Dockerfile-old.tmpl b/docker/Dockerfile-old.tmpl
new file mode 100644
index 0000000..9ad0c55
--- /dev/null
+++ b/docker/Dockerfile-old.tmpl
@@ -0,0 +1,21 @@
+# syntax=docker/dockerfile:experimental
+
+FROM registry.startx.be/infra/drupal_docker/drupal-dev
+
+RUN --mount=type=ssh \
+    rm -r /var/www/html && \
+    git clone $CI_REPOSITORY_URL /var/www/drupal && \
+    cd /var/www/drupal && \
+    git reset --hard $CI_COMMIT_SHA && \
+    composer install
+
+FROM registry.startx.be/infra/drupal_docker/drupal-base-wkhtmltopdf
+
+COPY --from=0 /var/www/drupal /var/www/drupal
+RUN rm -r /var/www/html && \
+    ln -s /var/www/drupal/web /var/www/html && \
+    mkdir /mnt/data && \
+    ln -s /data/msmtprc /etc/msmtprc && \
+    ln -s /data/settings.php /var/www/html/sites/default/ && \
+    ln -s /data/files /var/www/html/sites/default/
+
diff --git a/docker/Dockerfile.tmpl b/docker/Dockerfile.tmpl
index 9ad0c55..c98bf03 100644
--- a/docker/Dockerfile.tmpl
+++ b/docker/Dockerfile.tmpl
@@ -1,5 +1,14 @@
 # syntax=docker/dockerfile:experimental
 
+# copied from https://github.com/docker-library/drupal/blob/2d0eb7d957831141166f5905500b6f86b629fe1f/9.3/php8.1/fpm-alpine3.16/Dockerfile
+
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
+
+
 FROM registry.startx.be/infra/drupal_docker/drupal-dev
 
 RUN --mount=type=ssh \
@@ -9,13 +18,18 @@ RUN --mount=type=ssh \
     git reset --hard $CI_COMMIT_SHA && \
     composer install
 
-FROM registry.startx.be/infra/drupal_docker/drupal-base-wkhtmltopdf
+# from https://www.drupal.org/docs/system-requirements/php-requirements
+FROM registry.startx.be/infra/drupal_docker/drupal-fpm
+
+COPY --from=0 /var/www/drupal /opt/drupal
 
-COPY --from=0 /var/www/drupal /var/www/drupal
-RUN rm -r /var/www/html && \
-    ln -s /var/www/drupal/web /var/www/html && \
+RUN set -eux; \
+    chown -R www-data:www-data web/sites web/modules web/themes; \
+    rmdir /var/www/html; \
+    ln -sf /opt/drupal/web /var/www/html; \
     mkdir /mnt/data && \
     ln -s /data/msmtprc /etc/msmtprc && \
     ln -s /data/settings.php /var/www/html/sites/default/ && \
     ln -s /data/files /var/www/html/sites/default/
 
+# vim:set ft=dockerfile:
-- 
GitLab


From d8c23094f9c7bf944014098a35f9b1c4e88d8055 Mon Sep 17 00:00:00 2001
From: s j <sj@1729.be>
Date: Mon, 13 Jun 2022 13:27:01 +0200
Subject: [PATCH 2/5] fix: .gitlab-ci.modules

---
 .gitlab-ci.modules | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.gitlab-ci.modules b/.gitlab-ci.modules
index 148234a..4ccf66a 100644
--- a/.gitlab-ci.modules
+++ b/.gitlab-ci.modules
@@ -1,4 +1,3 @@
 "web/modules/custom/{$name}" drupal/druplan
 "web/modules/custom/{$name}" drupal/resource_planning
 "web/modules/custom/{$name}" drupal/druplan_theme
-
-- 
GitLab


From 0733559bb3392f16fde585e71581aae460175d53 Mon Sep 17 00:00:00 2001
From: s j <sj@1729.be>
Date: Tue, 14 Jun 2022 06:54:24 +0200
Subject: [PATCH 3/5] fix: move custom installer-paths before contrib to allow
 gitlab-ci to move .gitlab-ci.modules in custom

---
 composer.json | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/composer.json b/composer.json
index 4a624ac..3a91596 100644
--- a/composer.json
+++ b/composer.json
@@ -99,6 +99,15 @@
       "web/core": [
         "type:drupal-core"
       ],
+      "web/modules/custom/{$name}": [
+        "type:drupal-custom-module"
+      ],
+      "web/profiles/custom/{$name}": [
+        "type:drupal-custom-profile"
+      ],
+      "web/themes/custom/{$name}": [
+        "type:drupal-custom-theme"
+      ],
       "web/libraries/{$name}": [
         "type:drupal-library"
       ],
@@ -113,15 +122,6 @@
       ],
       "drush/Commands/contrib/{$name}": [
         "type:drupal-drush"
-      ],
-      "web/modules/custom/{$name}": [
-        "type:drupal-custom-module"
-      ],
-      "web/profiles/custom/{$name}": [
-        "type:drupal-custom-profile"
-      ],
-      "web/themes/custom/{$name}": [
-        "type:drupal-custom-theme"
       ]
     },
     "drupal-core-project-message": {
-- 
GitLab


From ada31bd5dc27f7ba0af90796190fb4de2394b80f Mon Sep 17 00:00:00 2001
From: s j <sj@1729.be>
Date: Tue, 14 Jun 2022 06:54:46 +0200
Subject: [PATCH 4/5] fix: .gitlab-ci.modules

---
 .gitlab-ci.modules | 2 +-
 composer.lock      | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.modules b/.gitlab-ci.modules
index 4ccf66a..f784ddf 100644
--- a/.gitlab-ci.modules
+++ b/.gitlab-ci.modules
@@ -1,3 +1,3 @@
 "web/modules/custom/{$name}" drupal/druplan
 "web/modules/custom/{$name}" drupal/resource_planning
-"web/modules/custom/{$name}" drupal/druplan_theme
+"web/themes/custom/{$name}" drupal/druplan_theme
diff --git a/composer.lock b/composer.lock
index e53196c..0f58bfc 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "c6db0feda5b8694d2ffe3122c5944130",
+    "content-hash": "183a0ab4b0c368cd3652f390cec9fae2",
     "packages": [
         {
             "name": "alchemy/zippy",
@@ -4955,8 +4955,8 @@
                     "version": "1.0.0",
                     "datestamp": "1591893292",
                     "security-coverage": {
-                        "status": "not-covered",
-                        "message": "Project has not opted into security advisory coverage!"
+                        "status": "covered",
+                        "message": "Covered by Drupal's security advisory policy"
                     }
                 }
             },
@@ -9858,6 +9858,7 @@
                     "type": "tidelift"
                 }
             ],
+            "abandoned": "symfony/error-handler",
             "time": "2021-09-24T13:30:14+00:00"
         },
         {
@@ -16273,5 +16274,5 @@
     "platform-overrides": {
         "php": "7.3"
     },
-    "plugin-api-version": "2.2.0"
+    "plugin-api-version": "2.3.0"
 }
-- 
GitLab


From 55cef058e9bb414284016a4d138d585fea3856f5 Mon Sep 17 00:00:00 2001
From: s j <sj@1729.be>
Date: Wed, 15 Jun 2022 07:07:42 +0200
Subject: [PATCH 5/5] imp: use drupal-k8s image

---
 docker/Dockerfile.tmpl | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/docker/Dockerfile.tmpl b/docker/Dockerfile.tmpl
index c98bf03..1e29659 100644
--- a/docker/Dockerfile.tmpl
+++ b/docker/Dockerfile.tmpl
@@ -1,14 +1,5 @@
 # syntax=docker/dockerfile:experimental
 
-# copied from https://github.com/docker-library/drupal/blob/2d0eb7d957831141166f5905500b6f86b629fe1f/9.3/php8.1/fpm-alpine3.16/Dockerfile
-
-#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
-#
-# PLEASE DO NOT EDIT IT DIRECTLY.
-#
-
-
 FROM registry.startx.be/infra/drupal_docker/drupal-dev
 
 RUN --mount=type=ssh \
@@ -18,18 +9,17 @@ RUN --mount=type=ssh \
     git reset --hard $CI_COMMIT_SHA && \
     composer install
 
-# from https://www.drupal.org/docs/system-requirements/php-requirements
-FROM registry.startx.be/infra/drupal_docker/drupal-fpm
+FROM registry.startx.be/infra/drupal_docker/drupal-k8s
 
 COPY --from=0 /var/www/drupal /opt/drupal
 
 RUN set -eux; \
-    chown -R www-data:www-data web/sites web/modules web/themes; \
-    rmdir /var/www/html; \
+    cd /opt/drupal; \
+    chown -R nginx:nginx web/sites web/modules web/themes; \
+    [ -d /var/www/html ] && rmdir /var/www/html; \
     ln -sf /opt/drupal/web /var/www/html; \
     mkdir /mnt/data && \
     ln -s /data/msmtprc /etc/msmtprc && \
     ln -s /data/settings.php /var/www/html/sites/default/ && \
     ln -s /data/files /var/www/html/sites/default/
 
-# vim:set ft=dockerfile:
-- 
GitLab