| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# Copyright (c) 2010-2025, Lawrence Livermore National Security, LLC. Produced |
| 4 |
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files |
| 5 |
# LICENSE and NOTICE for details. LLNL-CODE-806117. |
| 6 |
# |
| 7 |
# This file is part of the MFEM library. For more information and source code |
| 8 |
# availability visit https://mfem.org. |
| 9 |
# |
| 10 |
# MFEM is free software; you can redistribute it and/or modify it under the |
| 11 |
# terms of the BSD-3 license. We welcome feedback and contributions, see file |
| 12 |
# CONTRIBUTING.md for details. |
| 13 |
|
| 14 |
# There will be collision between corona and dane baselines. |
| 15 |
# Once the corresponding files have been generated, we can switch to machine |
| 16 |
# specific ref. |
| 17 |
ARTIFACT_PATH=${CI_PROJECT_DIR}/${ARTIFACTS_DIR}/baseline-${SYS_TYPE} |
| 18 |
#ARTIFACT_PATH=${CI_PROJECT_DIR}/${ARTIFACTS_DIR}/baseline-${SYS_TYPE}-${MACHINE_NAME} |
| 19 |
|
| 20 |
PATCH_FILE=${ARTIFACT_PATH}.patch |
| 21 |
FULL_FILE=${ARTIFACT_PATH}.out |
| 22 |
DIFF_FILE=${ARTIFACT_PATH}.diff |
| 23 |
|
| 24 |
# There will be collision between corona and dane baselines. |
| 25 |
# Once the corresponding files have been generated, we can switch to machine |
| 26 |
# specific ref. |
| 27 |
SAVED_NAME=baseline-${SYS_TYPE}.saved |
| 28 |
#SAVED_NAME=baseline-${SYS_TYPE}-${MACHINE_NAME}.saved |
| 29 |
|
| 30 |
cd ${BUILD_ROOT}/tests |
| 31 |
|
| 32 |
if [[ ! -f "${DIFF_FILE}" ]] |
| 33 |
then |
| 34 |
echo "Nothing to be done: no relevant change in baseline" |
| 35 |
exit 0 |
| 36 |
elif [[ -f "${PATCH_FILE}" ]] |
| 37 |
then |
| 38 |
patch "${SAVED_NAME}" < "${PATCH_FILE}" |
| 39 |
elif [[ -f "${FULL_FILE}" ]] |
| 40 |
then |
| 41 |
cp "${FULL_FILE}" "${SAVED_NAME}" |
| 42 |
else |
| 43 |
echo "File missing: expected ${PATCH_FILE} or ${FULL_FILE}" |
| 44 |
exit 1 |
| 45 |
fi |
| 46 |
|
| 47 |
git add "${SAVED_NAME}" |
| 48 |
git commit -m "${SYS_TYPE} (${MACHINE_NAME}) rebaselined in GitLab pipeline ${CI_PIPELINE_ID}" |
| 49 |
git push origin master |