<commit_before>#! /bin/bash

# given a version, tag & push all data-prep LOCAL images with this version to talend-registry

version=$1

if [ -z "$version"  ]; then
  echo "please specify a version"
  exit 1
fi

if [[ "$2" != "--ni" ]]; then
  echo 'WARNING: you are going to erase images already pushed to the registry!'
  read -p "Are you sure (YES to continue)? " yn
  if [[ "$yn" != "YES" ]]; then
    exit 1
  fi
fi

images=`more docker_images.txt | grep images | cut --delimiter='=' --fields=2`
registry=`more docker_images.txt | grep registry | cut --delimiter='=' --fields=2`

for image in $images;
do
  completeName=$image:$version
  echo ========================================
  echo $completeName
  echo ========================================
  docker tag --force $completeName $registry/$completeName
  docker push $registry/$completeName
  echo ========================================
  echo
done
<commit_msg>Tooling: push all images first to avoid images are changed by another build while still pushing previous<commit_after>#! /bin/bash

# given a version, tag & push all data-prep LOCAL images with this version to talend-registry

version=$1

if [ -z "$version"  ]; then
  echo "please specify a version"
  exit 1
fi

if [[ "$2" != "--ni" ]]; then
  echo 'WARNING: you are going to erase images already pushed to the registry!'
  read -p "Are you sure (YES to continue)? " yn
  if [[ "$yn" != "YES" ]]; then
    exit 1
  fi
fi

images=`more docker_images.txt | grep images | cut --delimiter='=' --fields=2`
registry=`more docker_images.txt | grep registry | cut --delimiter='=' --fields=2`

for image in $images;
do
  completeName=$image:$version
  echo 'docker tag --force '$completeName $registry/$completeName
  docker tag --force $completeName $registry/$completeName
done

for image in $images;
do
  completeName=$image:$version
  echo 'docker push '$registry/$completeName
  docker push $registry/$completeName
done

{'fraction_non_alphanumeric': 0.17952674897119342, 'fraction_numerical': 0.006172839506172839, 'mean_word_length': 4.118421052631579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5909574', 'n_tokens_mistral': 608, 'n_tokens_neox': 564, 'n_words': 223}