# echo "POST-CHECKOUT" # echo "PREV-HEAD=$1" # echo "CURR-HEAD=$2" # echo "BRANCH-CHECKOUT=$3" 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 # 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 line="$repo:$branch" readonly now="$(date +%Y-%m-%dT%T)" 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 "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 echo "Found existing line: $line. Do nothing" fi else echo "*******************************************************" echo " $ch_file DOES NOT EXIST !!! " echo "*******************************************************" fi