diff --git a/deploy_app.sh b/deploy_app.sh index 209113745839703a4420e7c0f140b266340ada4e..6f64e58b71ac99bf957d42616b6079f7cfd72fcb 100755 --- a/deploy_app.sh +++ b/deploy_app.sh @@ -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