diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3ce39d4768cbdf73f86c16fabae14e7f86d7fabf..f38951c68cf8f2824f0ff0f0b72d634b83651030 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -205,11 +205,10 @@ build-spack-env-on-runner: after_script: - mkdir -p $CI_PROJECT_DIR/spack_logs/installed $CI_PROJECT_DIR/spack_logs/not_installed # for succesfully installed packages: keep the spack logs for any package modified during this CI job - - cd $SPACK_DEV_PATH/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0 - - find . \( -name ".spack" -o -name ".spack_test_results" -o -name ".build" \) -exec cp -r --parents "{}" $CI_PROJECT_DIR/spack_logs/installed \; + - PKG_DIR=$SPACK_DEV_PATH/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0 + - if cd $PKG_DIR; then find . \( -name ".spack" -o -name ".build" -o -name ".spack_test_results" \) -exec cp -r --parents "{}" $CI_PROJECT_DIR/spack_logs/installed \;; fi # for not succesfully installed packages: also keep the spack logs for any packages that failed - - cd /tmp/$(whoami)/spack-stage/ - - find . -maxdepth 2 -name "*.txt" -exec cp --parents "{}" $CI_PROJECT_DIR/spack_logs/not_installed \; + - if cd /tmp/$(whoami)/spack-stage/; then find . -maxdepth 2 -name "*.txt" -exec cp --parents "{}" $CI_PROJECT_DIR/spack_logs/not_installed \;; fi artifacts: paths: - spack_logs @@ -277,11 +276,10 @@ sync-gitlab-spack-instance: - mkdir -p $CI_PROJECT_DIR/spack_logs/installed $CI_PROJECT_DIR/spack_logs/not_installed # for 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) - - cd $SPACK_PATH/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0 - - find . \( -name ".spack" -o -name ".spack_test_results" -o -name ".build" \) -newer $SPACK_REPO_PATH/repo.yaml -exec cp -r --parents "{}" $CI_PROJECT_DIR/spack_logs/installed \; + - PKG_DIR=$SPACK_PATH/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0 + - if cd $PKG_DIR; then find . -newer $SPACK_REPO_PATH/repo.yaml \( -name ".spack" -o -name ".spack_test_results" -o -name ".build" \) -exec cp -r --parents "{}" $CI_PROJECT_DIR/spack_logs/installed \;; fi # for not succesfully installed packages: also keep the spack logs for any packages that failed - - cd /tmp/$(whoami)/spack-stage/ - - find . -maxdepth 2 -name "*.txt" -exec cp --parents "{}" $CI_PROJECT_DIR/spack_logs/not_installed \; + - if cd /tmp/$(whoami)/spack-stage/; then find . -maxdepth 2 -name "*.txt" -exec cp --parents "{}" $CI_PROJECT_DIR/spack_logs/not_installed \;; fi artifacts: paths: - spack_logs