Testing. Add known files to be downloaded/executed.

This commit is contained in:
Gerhard Hoffmann 2023-05-25 15:31:02 +02:00
parent b6137a41f2
commit 7db36e8de4

View File

@ -1,20 +1,36 @@
echo "POST-CHECKOUT" # echo "POST-CHECKOUT"
echo "PREV-HEAD=$1" # echo "PREV-HEAD=$1"
echo "CURR-HEAD=$2" # echo "CURR-HEAD=$2"
echo "BRANCH-CHECKOUT=$3" # echo "BRANCH-CHECKOUT=$3"
readonly ch_file="/opt/app/tools/atbupdate/checkout_history" readonly ch_file="/opt/app/tools/atbupdate/checkout_history"
readonly update_log_file="/opt/app/tools/atbupdate/update_log.csv" readonly update_log_file="/opt/app/tools/atbupdate/update_log.csv"
if [ -f $ch_file ]; then if [ -f $ch_file ]; then
readonly repo=$(basename $(git rev-parse --show-toplevel)) # repo: customer_281
readonly repo=$(basename $(git rev-parse --show-toplevel))
# branch: customer_281:HEAD->zg1/zone1,origin/zg1/zone1
readonly branch=$(git log --graph --all --decorate $2 | head -n 1 | sed -E -e 's/(.*?)\((.*)\)/\2/g' | sed -E -e s/[[:space:]]//g) readonly branch=$(git log --graph --all --decorate $2 | head -n 1 | sed -E -e 's/(.*?)\((.*)\)/\2/g' | sed -E -e s/[[:space:]]//g)
line="$repo:$branch" readonly line="$repo:$branch"
echo "line=$line" readonly now="$(date +%Y-%m-%dT%T)"
if ! grep -Eq "$line" $ch_file; then if ! grep -Eq "$line" $ch_file; then
# line not found. first checkout of this branch (on this PSA).
# mark dc and print-templates to be downloaded by update-tool.
# mark opkg_commdands-file to be executed by update-tool.
echo $line >> $ch_file echo $line >> $ch_file
echo "DOWNLOAD, /etc/dc/dc2c.4.21.bin, $(date +%Y-%m-%dT%T), N/A" >> $update_log_file echo "DOWNLOAD, /etc/dc/dc2c.4.21.bin, $now, N/A" >> $update_log_file
echo "DOWNLOAD, /etc/psa_config/DC2C_print01.json, $now, N/A" >> $update_log_file
echo "DOWNLOAD, /etc/psa_config/DC2C_print02.json, $now, N/A" >> $update_log_file
echo "DOWNLOAD, /etc/psa_config/DC2C_print03.json, $now, N/A" >> $update_log_file
echo "DOWNLOAD, /etc/psa_config/DC2C_print04.json, $now, N/A" >> $update_log_file
echo "DOWNLOAD, /etc/psa_config/DC2C_print29.json, $now, N/A" >> $update_log_file
echo "DOWNLOAD, /etc/psa_config/DC2C_print32.json, $now, N/A" >> $update_log_file
echo "EXECUTE, /etc/psa_update/opkg_commands, $now, N/A" >> $update_log_file
else else
echo "Found $line. Do nothing" echo "Found existing line: $line. Do nothing"
fi fi
else
echo "*******************************************************"
echo " $ch_file DOES NOT EXIST !!! "
echo "*******************************************************"
fi fi