Test: add an entry into update_log.csv

This commit is contained in:
Gerhard Hoffmann 2023-05-25 14:51:42 +02:00
parent a9cb3b53f4
commit d3847df593

View File

@ -3,8 +3,15 @@ echo "PREV-HEAD=$1"
echo "CURR-HEAD=$2"
echo "BRANCH-CHECKOUT=$3"
if [ -f /opt/app/tools/atbupdate/checkout_history ]; then
readonly repo=i$(basename $(git rev-parse --show-toplevel))
readonly ch_file="/opt/app/tools/atbupdate/checkout_history"
readonly update_log_file="/opt/app/tools/atbupdate/update_log.csv"
if [ -f $ch_file ]; then
readonly repo=$(basename $(git rev-parse --show-toplevel))
readonly branch=$(git log --graph --all --decorate $2 | head -n 1 | sed -E -e 's/(.*?)(\(.*\))/\2/g')
echo "$repo:$branch"
line="$repo:$branch"
if ! grep -Eq $line $ch_file; then
echo $line >> $ch_file
echo "DOWNLOAD, /etc/dc/dc2c.4.21.bin, $(date +%Y-%m-%dT%T, N/A)" >> $update_log_file
fi
fi