From 26e67e1d0eef8dbb4d94973e54c6b3ed9a42f391 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roman=20Dvo=C5=99=C3=A1k?= <xdvora19@fi.muni.cz>
Date: Thu, 30 May 2024 00:12:14 +0200
Subject: [PATCH] reformat utilities and edit gitlab ci for testing purposes

---
 .gitlab-ci.yml |  3 ---
 utilities.sh   | 31 ++++++++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3b04b48..15cc99a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -15,11 +15,8 @@ pages:
     - pip install poetry==1.8.2
     - poetry install
     - poetry run ./utilities.sh
-    - poetry run mkdocs build --strict --verbose --site-dir public
   artifacts:
     paths:
       - public
-  only:
-    - main
   tags:
     - inject
diff --git a/utilities.sh b/utilities.sh
index 8fc14c9..e0e084e 100755
--- a/utilities.sh
+++ b/utilities.sh
@@ -1,11 +1,40 @@
 #!/usr/bin/env bash
+
+# Enable debugging
+set -x
+
+# Initialize and update git submodules
 git submodule init
 git submodule update --remote
 
+# Check the status of the git submodules
+git submodule status
+
+# Create necessary directories
 mkdir -p docs/tech
 mkdir -p files-from-repos
+
+# Print the current directory structure
+echo "Directory structure before copying files:"
+ls -R
+
+# Copy files to the respective directories
 cp ./backend/definitions/README.md ./docs/tech/architecture/definitions.md
 cp ./backend/CHANGELOG.md ./docs/tech/architecture/CHANGELOG.md
 cp ./backend/openapi.yml ./docs/tech/api/openapi.yml
 cp ./frontend/docker/nginx-deployment/README.md ./files-from-repos/nginx-README.md
-zip -r ./files-from-repos/deployment-files.zip ./frontend/docker/nginx-deployment/
\ No newline at end of file
+
+# Check if the files are copied correctly
+echo "Directory structure after copying files:"
+ls -R
+
+# Zip the deployment files
+zip -r ./files-from-repos/deployment-files.zip ./frontend/docker/nginx-deployment/
+
+# Check if the zip operation was successful
+if [ $? -eq 0 ]; then
+  echo "Zipping successful: ./files-from-repos/deployment-files.zip"
+else
+  echo "Zipping failed"
+  exit 1
+fi
\ No newline at end of file
-- 
GitLab