From ea4be358769f2d6e7cf601520354adcf3c34268f Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Mon, 25 Jan 2021 16:03:33 +0100
Subject: [PATCH] gitlab-ci-cd/drupal#2 Add support for first installation in
 artefact mode

---
 tasks/finalize/artefact.yml | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/tasks/finalize/artefact.yml b/tasks/finalize/artefact.yml
index 24c2411..fc07ead 100644
--- a/tasks/finalize/artefact.yml
+++ b/tasks/finalize/artefact.yml
@@ -3,7 +3,7 @@
 
 - block:
 
-    - name: Set facts
+    - name: Set facts for updates
       set_fact:
         artefact_directories:
           - src: '{{ webRoot }}/drush/drush.yml'
@@ -25,6 +25,25 @@
             dest: '{{ tempDeployRoot }}-old'
           - src: '{{ tempDeployRoot }}'
             dest: '{{ webRoot }}'
+      when: not drupal_first_installation
+
+    - name: Set facts first installation
+      set_fact:
+        artefact_directories:
+          - src: '{{ webRoot }}/files'
+            dest: '{{ tempDeployRoot }}/files'
+            reset: true
+          - src: '{{ webRoot }}/settings'
+            dest: '{{ tempDeployRoot }}/settings'
+            reset: true
+          - src: '{{ webRoot }}/web/sites/default'
+            dest: '{{ tempDeployRoot }}/web/sites/default'
+            reset: true
+          - src: '{{ webRoot }}'
+            dest: '{{ tempDeployRoot }}-old'
+          - src: '{{ tempDeployRoot }}'
+            dest: '{{ webRoot }}'
+      when: drupal_first_installation
 
     - name: Reset destination directories
       file:
-- 
GitLab