From 3107f01b05cc1696429db567105dce7f1220ecc7 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen.haas@lakedrops.com>
Date: Tue, 23 Jan 2024 10:38:31 +0100
Subject: [PATCH] Add new ChatOps task CollectPublicFiles

---
 data-handling-ng.yml | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/data-handling-ng.yml b/data-handling-ng.yml
index 4f39e4f..cdc3d97 100644
--- a/data-handling-ng.yml
+++ b/data-handling-ng.yml
@@ -97,7 +97,7 @@ CollectDatabaseManual:
     - branch=${CHAT_INPUT}${TRIGGER_INPUT}
     - if [[ ! -d /data/${branch} ]]; then echo "Branch $branch does not exist"; exit 1; fi
     - cd /data/${branch}/files
-    - tar --exclude={"cae","css","js","languages","pdfpreview","php","styles","translations","video_thumbnails"} -czvf files.tar.gz public private
+    - tar --exclude={"cae","css","js","languages","pdfpreview","php","styles","translations","video_thumbnails"} -czvf files.tar.gz $COLLECT_DIRECTORIES
     - cd -
     - mv /data/${branch}/files/files.tar.gz .
   artifacts:
@@ -108,6 +108,8 @@ CollectDatabaseManual:
 
 CollectFiles:
   extends: .CollectFiles
+  variables:
+    COLLECT_DIRECTORIES: public private
   only:
     refs:
       - triggers
@@ -117,10 +119,31 @@ CollectFiles:
 
 CollectFilesManual:
   extends: .CollectFiles
+  variables:
+    COLLECT_DIRECTORIES: public private
   only:
     variables:
       - $TRIGGERMODE == 'manual' && $TRIGGERTASK == 'CollectFiles'
 
+CollectPublicFiles:
+  extends: .CollectFiles
+  variables:
+    COLLECT_DIRECTORIES: public
+  only:
+    refs:
+      - triggers
+      - chat
+    variables:
+      - $CI_PIPELINE_SOURCE == 'chat' || $TRIGGERTASK == 'CollectPublicFiles'
+
+CollectPublicFilesManual:
+  extends: .CollectFiles
+  variables:
+    COLLECT_DIRECTORIES: public
+  only:
+    variables:
+      - $TRIGGERMODE == 'manual' && $TRIGGERTASK == 'CollectPublicFiles'
+
 CopyDataToStage:
   variables:
     GIT_STRATEGY: none
-- 
GitLab