From c428d04c83ac418b36444729ad4efad0aa08eb07 Mon Sep 17 00:00:00 2001
From: Eleni Mathioulaki <emathioulaki@athenarc.gr>
Date: Tue, 14 Feb 2023 19:46:33 +0100
Subject: [PATCH] fix log collection

---
 .gitlab-ci.yml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8e054fd8..3dda567e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -187,10 +187,10 @@ build-spack-env-on-runner:
     - mkdir spack_logs
     # succesfully installed packages: keep the spack logs for any package modified during this CI job
     - cp --parents $SPACK_DEV_PATH/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0/*/.spack/*.txt ./
-    - mv .$SPACK_DEV_PATH/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0 spack_logs/installed
+    - mv .$SPACK_DEV_PATH/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0 spack_logs/installed || echo "No logs for installed packages"
     # not succesfully installed packages: also keep the spack logs for any packages that failed
     - cp --parents /tmp/$(whoami)/spack-stage/*/*.txt ./
-    - mv ./tmp/$(whoami)/spack-stage spack_logs/not_installed
+    - mv ./tmp/$(whoami)/spack-stage spack_logs/not_installed || echo "No logs for not-installed packages"
   artifacts:
     paths:
       - spack_logs
@@ -251,10 +251,10 @@ sync-gitlab-spack-instance:
     # succesfully installed packages: keep the spack logs for any package modified during this CI job
     # (we use repo.yaml, that is modified at each start of the pipeline, as a reference file)
     - find $SPACK_PATH/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0/*/.spack/*.txt -newer $SPACK_REPO_PATH/repo.yaml -exec cp --parents -r "{}" ./ \;
-    - mv .$SPACK_PATH/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0 spack_logs/installed
+    - mv .$SPACK_PATH/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0 spack_logs/installed || echo "No logs for installed packages"
     # not succesfully installed packages: also keep the spack logs for any packages that failed
     - cp --parents /tmp/$(whoami)/spack-stage/*/*.txt ./
-    - mv ./tmp/$(whoami)/spack-stage spack_logs/not_installed
+    - mv ./tmp/$(whoami)/spack-stage spack_logs/not_installed || echo "No logs for not-installed packages"
   artifacts:
     paths:
       - spack_logs
-- 
GitLab