#!/bin/bash # to use ensure cz_exit=0 is set prior to the cz command so that if the command is successfull, this script works # this script must be run with '. {script-name}' so that vars set in cli are available cz_command=$(cat "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/cz_output.log") if [ "f${cz_exit}" == "f" ]; then echo "[DEBUG] environmental variable cz_exit must be set" exit 255 fi if [ "${cz_exit}" == "0" ]; then error_count=0 system_err='' cat < EOF else error_count=1 system_err="ERROR: $cz_command" cat < $cz_command EOF fi #echo boo; #echo "output:[$cz_command]" #echo "[DEBUG] cz_exit[$cz_exit]" exit $cz_exit