Loading .gitlab-ci.yml +11 −6 Original line number Diff line number Diff line Loading @@ -1671,11 +1671,15 @@ ivas-long-term-job-logs: # Clean up logs - if [ -d "logs" ]; then rm -rf "logs"; fi # Inject logs from backup copy if LOGS_BACKUP_SOURCE_DIR is set - if [ -d "$LOGS_BACKUP_SOURCE_DIR" ]; then - cp -r $LOGS_BACKUP_SOURCE_DIR/logs . - if [ "$LOGS_BACKUP_SOURCE_DIR" != "" ]; then - cp_ret=0 - cp -r $LOGS_BACKUP_SOURCE_DIR/logs ./ || cp_ret=$? - if [ "$cp_ret" != 0 ]; then - echo "Error -- Copying to $LOGS_BACKUP_SOURCE_DIR failed!" - exit 1 - fi - fi # handle case where the job is running for the first time. e.g where the job was not found. - id_previous=$(python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH "$CI_JOB_NAME" $CI_PROJECT_ID) - echo "Job name from variables - "$CI_JOB_NAME", Job ID from script - $id_previous" Loading @@ -1685,7 +1689,8 @@ ivas-long-term-job-logs: # If there is overlap between injected log and new log, use the new logs. - unzip -o artifacts.zip - else # create logs dir if it doesn't exist # create logs dir if it doesn't exist (should only happen in first run) - echo "Could not find previous job, creating empty logs folder. If this is not the first run, an error likely happened!" - mkdir logs - fi Loading Loading @@ -1751,10 +1756,10 @@ backup-long-term-job-logs: # Store logs as backup copy if LOGS_BACKUP_TARGET_DIR is set - if [ -d "$LOGS_BACKUP_TARGET_DIR" ]; then - cp -r logs $LOGS_BACKUP_TARGET_DIR - exit 0; - exit 0 - else - echo "Error - LOGS_BACKUP_TARGET_DIR not set for backup job!" - exit -1; - exit 1 - fi Loading Loading
.gitlab-ci.yml +11 −6 Original line number Diff line number Diff line Loading @@ -1671,11 +1671,15 @@ ivas-long-term-job-logs: # Clean up logs - if [ -d "logs" ]; then rm -rf "logs"; fi # Inject logs from backup copy if LOGS_BACKUP_SOURCE_DIR is set - if [ -d "$LOGS_BACKUP_SOURCE_DIR" ]; then - cp -r $LOGS_BACKUP_SOURCE_DIR/logs . - if [ "$LOGS_BACKUP_SOURCE_DIR" != "" ]; then - cp_ret=0 - cp -r $LOGS_BACKUP_SOURCE_DIR/logs ./ || cp_ret=$? - if [ "$cp_ret" != 0 ]; then - echo "Error -- Copying to $LOGS_BACKUP_SOURCE_DIR failed!" - exit 1 - fi - fi # handle case where the job is running for the first time. e.g where the job was not found. - id_previous=$(python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH "$CI_JOB_NAME" $CI_PROJECT_ID) - echo "Job name from variables - "$CI_JOB_NAME", Job ID from script - $id_previous" Loading @@ -1685,7 +1689,8 @@ ivas-long-term-job-logs: # If there is overlap between injected log and new log, use the new logs. - unzip -o artifacts.zip - else # create logs dir if it doesn't exist # create logs dir if it doesn't exist (should only happen in first run) - echo "Could not find previous job, creating empty logs folder. If this is not the first run, an error likely happened!" - mkdir logs - fi Loading Loading @@ -1751,10 +1756,10 @@ backup-long-term-job-logs: # Store logs as backup copy if LOGS_BACKUP_TARGET_DIR is set - if [ -d "$LOGS_BACKUP_TARGET_DIR" ]; then - cp -r logs $LOGS_BACKUP_TARGET_DIR - exit 0; - exit 0 - else - echo "Error - LOGS_BACKUP_TARGET_DIR not set for backup job!" - exit -1; - exit 1 - fi Loading