<commit_before>#!/usr/bin/env bash
nexusPassword=$1
nexusHost=$2
githubToken=$3

set -e

currentHashCommit=`git rev-parse HEAD`
formattedDate=`date '+%Y-%m-%d-%H-%M'`
currentVersion=`cat version.sbt | grep "version in ThisBuild :=" | grep -Po '\K([^"]*)(?=-SNAPSHOT)'`
version=${formattedDate}-${currentHashCommit}-${currentVersion}

if [ -z "$nexusPassword" ]; then
    echo "nexusPassword missing"; exit -1
fi
if [ -z "$nexusHost" ]; then
    echo "nexusHost missing"; exit -1
fi

echo publishing nussknacker version: $version
# ./sbtwrapper clean test management/it:test
./sbtwrapper -DnexusPassword=${nexusPassword} -DnexusHost=${nexusHost} "set version in ThisBuild := \"$version\"" publish

#if [[ ! -z $githubToken ]]; then
#  # push to github mirror
#  git remote | grep github || git remote add github "https://$githubToken:x-oauth-basic@github.com/touk/nussknacker"
#  git fetch github
#  git push github HEAD:master
#
#  # build & publish github doc
#  [ -f node_modules/.bin/gitbook ] || npm install gitbook-cli
#  PATH="$PATH:$(readlink -f node_modules/.bin)"
#  cd docs
#  ./publishToGithub.sh $githubToken
#fi<commit_msg>Revert "remove snapshot sufix for release"<commit_after>#!/usr/bin/env bash
nexusPassword=$1
nexusHost=$2
githubToken=$3

set -e

currentHashCommit=`git rev-parse HEAD`
formattedDate=`date '+%Y-%m-%d-%H-%M'`
currentVersion=`cat version.sbt | grep "version in ThisBuild :=" | grep -Po '= "\K[^"]*'`
version=${formattedDate}-${currentHashCommit}-${currentVersion}

if [ -z "$nexusPassword" ]; then
    echo "nexusPassword missing"; exit -1
fi
if [ -z "$nexusHost" ]; then
    echo "nexusHost missing"; exit -1
fi

echo publishing nussknacker version: $version
./sbtwrapper clean test management/it:test
./sbtwrapper -DnexusPassword=${nexusPassword} -DnexusHost=${nexusHost} "set version in ThisBuild := \"$version\"" publish

if [[ ! -z $githubToken ]]; then
  # push to github mirror
  git remote | grep github || git remote add github "https://$githubToken:x-oauth-basic@github.com/touk/nussknacker"
  git fetch github
  git push github HEAD:master
  
  # build & publish github doc
  [ -f node_modules/.bin/gitbook ] || npm install gitbook-cli
  PATH="$PATH:$(readlink -f node_modules/.bin)"
  cd docs
  ./publishToGithub.sh $githubToken
fi
{'fraction_non_alphanumeric': 0.15634606938954765, 'fraction_numerical': 0.004391743522178305, 'mean_word_length': 4.624691358024691, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5172061', 'n_tokens_mistral': 812, 'n_tokens_neox': 769, 'n_words': 206}