#!/bin/sh

sed -n 's$.*"image":[^:]*/\([^/]*\):.*$\1$p' $1 |

while IFS= read -r line
do
  latest_tag=$($ZOOX_WORKSPACE_ROOT/data/ingest/docker_images/get_latest_tag.py $line)
  next_tag=$((latest_tag+1))
  echo "Image: $line, latest tag: $latest_tag, next tag: $next_tag "
  $ZOOX_WORKSPACE_ROOT/data/ingest/docker_images/build_and_push_ingest_job.sh $line prod $next_tag
  echo "One processed"
done
