<commit_before>#! /bin/bash

status=`git status --short`
if [ -n "$status"  ]; then
  echo "git status non vide, dégage !!"
#  exit 1
fi

echo 'Release to prepare '$1', message '$2
read -p "Proceed (NO to exit)? " yn
if [[ "$yn" = "NO" ]]; then
  exit 1
fi

execute () {
  echo "Next step is <$1>"
  read -p "Proceed (NO to exit)? " yn
  if [[ "$yn" = "NO" ]]; then
    exit 1
  fi
  echo ========================================================================
  echo '           Processing command <'$1'>'
  echo ========================================================================
  $1
  $2
  echo ========================================================================
  echo
  echo
  echo
}

execute 'git checkout release/'$1
execute 'git pull --rebase origin release/'$1

execute 'git branch -d release/'$1
echo "Release '$1' : $2" > /tmp/commit_msg
execute 'git tag -a release/'$1' --file=/tmp/commit_msg'
execute 'git push --tags'

# here publish docker images to registry
<commit_msg>Tooling: small changes in finish-release.sh<commit_after>#! /bin/bash

status=`git status --short --untracked-files=no`
if [ -n "$status"  ]; then
  echo "git status non vide, dégage !!"
  exit 1
fi

echo 'Release to prepare '$1', message '$2
read -p "Proceed (NO to exit)? " yn
if [[ "$yn" = "NO" ]]; then
  exit 1
fi

execute () {
  echo "Next step is <$1>"
  read -p "Proceed (NO to exit)? " yn
  if [[ "$yn" = "NO" ]]; then
    exit 1
  fi
  echo ========================================================================
  echo '           Processing command <'$1'>'
  echo ========================================================================
  $1
  $2
  echo ========================================================================
  echo
  echo
  echo
}

execute 'git checkout release/'$1
execute 'git pull --rebase origin release/'$1

execute 'git branch -d release/'$1
echo "Release '$1' : $2" > /tmp/commit_msg
execute 'git tag -a '$1' --file=/tmp/commit_msg'
execute 'git push --tags'

# here publish docker images to registry
./pushDockerImages.sh $1
./publishDockerImages.sh $1

./pushDockerImages.sh latest
./publishDockerImages.sh latest
{'fraction_non_alphanumeric': 0.3266728624535316, 'fraction_numerical': 0.01486988847583643, 'mean_word_length': 3.915525114155251, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '5906884', 'n_tokens_mistral': 686, 'n_tokens_neox': 637, 'n_words': 227}