Skip to content
Snippets Groups Projects

add lines to profile log on error

Merged Hahn Axel (hahn) requested to merge 6877_final_status_in_log into master
1 file
+ 12
4
Compare changes
  • Side-by-side
  • Inline
+ 12
4
@@ -17,6 +17,7 @@
# 2023-02-14 v1.0 <axel.hahn@unibe.ch> set v1.0 (no changes)
# 2023-12-?? v1.1 <axel.hahn@unibe.ch> show OK message in profile log
# 2023-12-14 v1.2 <axel.hahn@unibe.ch> export some vars; abort on errors
# 2023-12-18 v1.3 <axel.hahn@unibe.ch> add lines to profile log on error
# ======================================================================
@@ -24,7 +25,7 @@
# CONFIG
# ----------------------------------------------------------------------
cd $( dirname $0 )
_version=1.2
_version=1.3
export selfdir; selfdir=$( /bin/pwd )
export profiledir
@@ -395,9 +396,16 @@ fi
test -d "${logdir}" || mkdir -p "${logdir}"
for myprofile in $allprofiles
do
( deploy $myprofile; logdelete $myprofile ) 2>&1 | tee ${logdir}/${myprofile}__$(date +%Y-%m-%d__%H%M%S).log
# test ${PIPESTATUS[0]} -eq 0 || exit ${PIPESTATUS[0]}
rc+=${PIPESTATUS[0]}
logfile=${logdir}/${myprofile}__$(date +%Y-%m-%d__%H%M%S).log
( deploy $myprofile; logdelete $myprofile ) 2>&1 | tee "${logfile}"
lastrc=${PIPESTATUS[0]}
if [ $lastrc -ne 0 ]; then
rc+=$lastrc
echo "The rollout of $myprofile was interrupted by an exitcode $lastrc." >> "${logfile}"
echo "FAILED $myprofile" >> "${logfile}"
fi
profile=
done
Loading