<commit_before>#!/bin/bash
set -ex

user="funcy"
service="fnlb"
tag="latest"

# ensure working dir is clean
git status
if [[ -z $(git status -s) ]]
then
  echo "tree is clean"
else
  echo "tree is dirty, please commit changes before running this"
  exit 1
fi

git pull

version_file="main.go"
if [ -z $(grep -m1 -Po '(?<= = ")\d+\.\d+\.\d+' $version_file) ]; then
  echo "did not find semantic version in $version_file"
  exit 1
fi
perl -i -pe 's/(?<= = ")\d+\.\d+\.\K(\d+)/$1+1/e' $version_file
version=$(grep -m1 -Po '(?<= = ")\d+\.\d+\.\d+' $version_file)
echo "Version: $version"

make docker-build

git add -u
git commit -m "$service: $version release [skip ci]"
git tag -f -a "$version" -m "version $version"
git push
git push origin $version

# Finally tag and push docker images
docker tag $user/$service:$tag $user/$service:$version
docker push $user/$service:$version
docker push $user/$service:$tag
<commit_msg>Use fnlb in the lb tags<commit_after>#!/bin/bash
set -ex

user="funcy"
service="fnlb"
tag="latest"

# ensure working dir is clean
git status
if [[ -z $(git status -s) ]]
then
  echo "tree is clean"
else
  echo "tree is dirty, please commit changes before running this"
  exit 1
fi

git pull

version_file="main.go"
if [ -z $(grep -m1 -Po '(?<= = ")\d+\.\d+\.\d+' $version_file) ]; then
  echo "did not find semantic version in $version_file"
  exit 1
fi
perl -i -pe 's/(?<= = ")\d+\.\d+\.\K(\d+)/$1+1/e' $version_file
version=$(grep -m1 -Po '(?<= = ")\d+\.\d+\.\d+' $version_file)
echo "Version: $version"

make docker-build

git add -u
git commit -m "$service: $version release [skip ci]"
git tag -f -a "fnlb-$version" -m "version fnlb-$version"
git push
git push origin $version

# Finally tag and push docker images
docker tag $user/$service:$tag $user/$service:$version
docker push $user/$service:$version
docker push $user/$service:$tag

{'fraction_non_alphanumeric': 0.18240343347639484, 'fraction_numerical': 0.006437768240343348, 'mean_word_length': 3.75765306122449, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1495399', 'n_tokens_mistral': 708, 'n_tokens_neox': 677, 'n_words': 237}