| | |
| | | # 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}]}' ) |
| | | |
| | |
| | | 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 (" ")' ) |
| | |
| | | sleep 1 |
| | | i=$(( ${i} + 1 )) |
| | | done |
| | | printf "Done with this receipt.\n\n" |
| | | printf "\nDone with this receipt." |
| | | printf "\n=======================\n\n" |
| | | done |
| | | done |
| | | |