From d734a0dc399eb18bae3908c96e8feae0bb7a71cd Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen.haas@lakedrops.com>
Date: Tue, 20 Feb 2024 10:00:31 +0100
Subject: [PATCH] gitlab-ci-cd/general#16 Create new mixin to merge a branch,
 use that in various places and ensure composer packages to always merge in
 the release stage

---
 lakedrops.yml       | 11 ++++++++++-
 test-and-deploy.yml | 43 ++-----------------------------------------
 2 files changed, 12 insertions(+), 42 deletions(-)

diff --git a/lakedrops.yml b/lakedrops.yml
index 84e4149..6c1da7b 100644
--- a/lakedrops.yml
+++ b/lakedrops.yml
@@ -45,6 +45,9 @@ variables:
   WAIT_HOSTS: 'redis:6379'
 
 include:
+  - project: gitlab-ci-cd/general
+    ref: main
+    file: '/mixins.yml'
   - project: 'gitlab-ci-cd/drupal'
     ref: main
     file: '/data-handling.yml'
@@ -70,7 +73,13 @@ Release:
   extends: '.createrelease'
 
 Publish Release:
-  extends: '.deployrelease'
+  extends: '.merge'
+  variables:
+    SOURCE_BRANCH: release
+  rules:
+    - if: $CI_COMMIT_REF_NAME != "release"
+      when: never
+    - if: $CI_PIPELINE_SOURCE == "schedule"
 
 LakeDrops:
   stage: execute
diff --git a/test-and-deploy.yml b/test-and-deploy.yml
index 7184f69..08a0365 100644
--- a/test-and-deploy.yml
+++ b/test-and-deploy.yml
@@ -631,24 +631,9 @@ Debug:
     - 'Build Theme'
 
 .createrelease:
-  stage: release
-  tags:
-    - default
+  extends: '.merge'
   variables:
-    GIT_STRATEGY: none
-  image: registry.lakedrops.com/docker/gitlab-drupal-ci/php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
-  cache: {}
-  before_script: !reference [.prepareaccess, before_script]
-  script:
-    - rm -rf /tmp/release || true
-    - mkdir -p /tmp/release
-    - cd /tmp/release
-    - git clone -b develop git@${CI_SERVER_HOST}:$CI_PROJECT_PATH.git .
-    - merge
-    - cd -
-    - rm -rf /tmp/release || true
-  dependencies:
-    - 'Validate Environment'
+    SOURCE_BRANCH: develop
   only:
     variables:
       - $CI_COMMIT_MESSAGE =~ /CREATE_RELEASE/
@@ -664,30 +649,6 @@ Debug:
       - $CHECKUPDATES
       - $TRIGGERTASK
 
-.deployrelease:
-  stage: release
-  tags:
-    - default
-  variables:
-    GIT_STRATEGY: none
-  image: registry.lakedrops.com/docker/gitlab-drupal-ci/php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
-  cache: {}
-  before_script: !reference [.prepareaccess, before_script]
-  script:
-    - rm -rf /tmp/release || true
-    - mkdir -p /tmp/release
-    - cd /tmp/release
-    - git clone -b release git@${CI_SERVER_HOST}:$CI_PROJECT_PATH.git .
-    - merge
-    - cd -
-    - rm -rf /tmp/release || true
-  dependencies:
-    - 'Validate Environment'
-  rules:
-    - if: $CI_COMMIT_REF_NAME != "release"
-      when: never
-    - if: $CI_PIPELINE_SOURCE == "schedule"
-
 .check4update:
   stage: test
   tags:
-- 
GitLab