<commit_before><commit_msg>Add post build javadoc publisher script<commit_after>#! /bin/sh

BRANCH=gh-pages

cd $WORKSPACE

version_line=$(cat pom.xml | egrep -o "<version>(.+)</version>" | head -n 1)
version=$(expr match $version_line "<version>\(.\+\)</version>")

if [[ $version == *-SNAPSHOT ]]; then
    dirname="apidocs-dev"
    commit_version="$version-b$BUILD_NUMBER"
else
    dirname="apidocs"
    commit_version="$version"
fi

rm -rf /tmp/${JOB_NAME}_apidocs
cp -R target/site/apidocs /tmp/${JOB_NAME}_apidocs

git checkout $BRANCH
git pull origin $BRANCH

rm -rf ./$dirname
mv /tmp/${JOB_NAME}_apidocs ./$dirname
git add . && git add -u
git commit -m "Update javadoc for $commit_version"

git push origin $BRANCH
git checkout master
{'fraction_non_alphanumeric': 0.15612382234185734, 'fraction_numerical': 0.0013458950201884253, 'mean_word_length': 4.470588235294118, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '4779767', 'n_tokens_mistral': 280, 'n_tokens_neox': 264, 'n_words': 71}