Olaf Bohlen
2023-01-02 79e42e3808e3c9cb80f4b2b42f9f09902366b2ca
receipt-processor.ksh
@@ -57,6 +57,8 @@
    # now that we have a list of updated receipts, we are going to process them
    for r in ${updatedreceipts}; do
   printf "\n\nNew receipt found: %s\n" "${receiptname[${r}]}"
   printf "--------------------------------------------------------------------------\n\n"
   # get the name for the UID and fetch only that object
   receipt=$(eval curl -XGET ${CURLOPTS} '${APIURL}/apis/de.eenfach.olbohlen/v1/namespaces/${NAMESPACE}/cookiereceipts/${receiptname[${r}]}' )
@@ -104,7 +106,7 @@
   num_steps=$(echo "${receipt}" | jq .spec.steps\[\].order | wc -l)
   # now let's iterate over that
   printf "Processing the instructions:\n"
   printf "\n\nProcessing the instructions:\n"
   i=1
   while [ ${i} -lt ${num_steps} ]; do
       instruction=$( echo "${receipt}" | jq '.spec.steps[] | select(.order == '${i}') | { instruction } | join (" ")' )
@@ -115,7 +117,8 @@
       sleep 1
       i=$(( ${i} + 1 ))
   done
   printf "Done with this receipt.\n\n"
   printf "\nDone with this receipt."
   printf "\n=======================\n\n"
    done
done