From 5dff0b5440d9866d5935489662a4a70548b47c6e Mon Sep 17 00:00:00 2001
From: Dejan <dejan@acolono.com>
Date: Thu, 16 Mar 2023 11:32:01 +0000
Subject: [PATCH] #51 missed fixing it for the CopyDataToStage task

---
 data-handling-ng.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/data-handling-ng.yml b/data-handling-ng.yml
index 5168f52..c45fc78 100644
--- a/data-handling-ng.yml
+++ b/data-handling-ng.yml
@@ -137,11 +137,11 @@ CopyDataToStage:
     - if [[ ! -d /data/${targetbranch}/app ]]; then echo "Target branch does not exist!"; exit 2; fi
     - if [[ "${targetbranch}" == "main" ]]; then echo "Main branch is not an allowed target!"; exit 3; fi
     - cd /data/${sourcebranch}/app
-    - SANITIZED_SOURCE_BRANCH_NAME=$(echo ${sourcebranch} | sed -r 's/[/_]+/-/g')
+    - SANITIZED_SOURCE_BRANCH_NAME=$(echo ${sourcebranch} | tr [:upper:] [:lower:] | sed -r 's/[/_]+/-/g')
     - docker compose --project-name ${PROJECT_NAME}_${SANITIZED_SOURCE_BRANCH_NAME} exec php drush sql:dump --result-file=/var/backups/mysql/drupal.sql
     - rsync -rlDzogtp /data/${sourcebranch}/files/ /data/${targetbranch}/files/
     - cd /data/${targetbranch}/app
-    - SANITIZED_TARGET_BRANCH_NAME=$(echo ${targetbranch} | sed -r 's/[/_]+/-/g')
+    - SANITIZED_TARGET_BRANCH_NAME=$(echo ${targetbranch} | tr [:upper:] [:lower:] | sed -r 's/[/_]+/-/g')
     - docker compose --project-name ${PROJECT_NAME}_${SANITIZED_TARGET_BRANCH_NAME} cp /data/${targetbranch}/files/db/drupal.sql php:/tmp
     - docker compose --project-name ${PROJECT_NAME}_${SANITIZED_TARGET_BRANCH_NAME} exec php drush -y sql:drop
     - docker compose --project-name ${PROJECT_NAME}_${SANITIZED_TARGET_BRANCH_NAME} exec php drush -y sql:query --file=/tmp/drupal.sql
-- 
GitLab