Skip to content
Snippets Groups Projects
Commit 24a04947 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

add lines to profile log on error

parent 7ddb6c3b
Branches
No related tags found
1 merge request!18add lines to profile log on error
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
# 2023-02-14 v1.0 <axel.hahn@unibe.ch> set v1.0 (no changes) # 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-?? 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-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 @@ ...@@ -24,7 +25,7 @@
# CONFIG # CONFIG
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
cd $( dirname $0 ) cd $( dirname $0 )
_version=1.2 _version=1.3
export selfdir; selfdir=$( /bin/pwd ) export selfdir; selfdir=$( /bin/pwd )
export profiledir export profiledir
...@@ -395,9 +396,16 @@ fi ...@@ -395,9 +396,16 @@ fi
test -d "${logdir}" || mkdir -p "${logdir}" test -d "${logdir}" || mkdir -p "${logdir}"
for myprofile in $allprofiles for myprofile in $allprofiles
do do
( deploy $myprofile; logdelete $myprofile ) 2>&1 | tee ${logdir}/${myprofile}__$(date +%Y-%m-%d__%H%M%S).log logfile=${logdir}/${myprofile}__$(date +%Y-%m-%d__%H%M%S).log
# test ${PIPESTATUS[0]} -eq 0 || exit ${PIPESTATUS[0]} ( deploy $myprofile; logdelete $myprofile ) 2>&1 | tee "${logfile}"
rc+=${PIPESTATUS[0]}
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= profile=
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment