<commit_before>#!/bin/sh

# do we have enough arguments?
if [ $# < 4 ]; then
    echo "Usage:"
    echo
    echo "./release.sh <release version> <development version> <milestone id>"
    exit 1
fi

# pick arguments
release=$1
devel=$2
milestone=$3

# get current branch
branch=$(git status -bs | awk '{ print $2 }' | awk -F'.' '{ print $1 }' | head -n 1)

# update changelog per Github milestone
mvn com.github.heuermh.maven.plugin.changes:github-changes-maven-plugin:1.1:github-changes -DmilestoneId=${milestone}
git commit -a -m "Modifying changelog."

commit=$(git log --pretty=format:"%H" | head -n 1)
echo "releasing from ${commit} on branch ${branch}"

git push origin ${branch}

# do spark 2, scala 2.11 release
git checkout -b maint_spark2_2.11-${release} ${branch}

mvn --batch-mode \
  -P distribution \
  -Dresume=false \
  -Dtag=cannoli-parent-spark2_2.11-${release} \
  -DreleaseVersion=${release} \
  -DdevelopmentVersion=${devel} \
  -DbranchName=cannoli-spark2_2.11-${release} \
  release:clean \
  release:prepare \
  release:perform

if [ $? != 0 ]; then
  echo "Releasing Spark 2, Scala 2.11 version failed."
  exit 1
fi

git checkout master

# do spark 2, scala 2.12 release
git checkout -b maint_spark2_2.12-${release} ${branch}

./scripts/move_to_scala_2.12.sh
git commit -a -m "Modifying pom.xml files for Spark 2, Scala 2.12 release."

mvn --batch-mode \
  -P distribution \
  -Dresume=false \
  -Dtag=cannoli-parent-spark2_2.12-${release} \
  -DreleaseVersion=${release} \
  -DdevelopmentVersion=${devel} \
  -DbranchName=cannoli-spark2_2.12-${release} \
  release:clean \
  release:prepare \
  release:perform<commit_msg>Fix release script, default is Spark 3 Scala 2.12 profile.<commit_after>#!/bin/sh

# do we have enough arguments?
if [ $# < 4 ]; then
    echo "Usage:"
    echo
    echo "./release.sh <release version> <development version> <milestone id>"
    exit 1
fi

# pick arguments
release=$1
devel=$2
milestone=$3

# get current branch
branch=$(git status -bs | awk '{ print $2 }' | awk -F'.' '{ print $1 }' | head -n 1)

# update changelog per Github milestone
mvn com.github.heuermh.maven.plugin.changes:github-changes-maven-plugin:1.1:github-changes -DmilestoneId=${milestone}
git commit -a -m "Modifying changelog."

commit=$(git log --pretty=format:"%H" | head -n 1)
echo "releasing from ${commit} on branch ${branch}"

git push origin ${branch}

# do spark 2, scala 2.11 release
git checkout -b maint_spark2_2.11-${release} ${branch}

./scripts/move_to_spark_2.sh
./scripts/move_to_scala_2.11.sh
git commit -a -m "Modifying pom.xml files for Spark 2, Scala 2.11 release."

mvn --batch-mode \
  -P distribution \
  -Dresume=false \
  -Dtag=cannoli-parent-spark2_2.11-${release} \
  -DreleaseVersion=${release} \
  -DdevelopmentVersion=${devel} \
  -DbranchName=cannoli-spark2_2.11-${release} \
  release:clean \
  release:prepare \
  release:perform

if [ $? != 0 ]; then
  echo "Releasing Spark 2, Scala 2.11 version failed."
  exit 1
fi

git checkout master

# do spark 2, scala 2.12 release
git checkout -b maint_spark2_2.12-${release} ${branch}

./scripts/move_to_spark_2.sh
./scripts/move_to_scala_2.12.sh
git commit -a -m "Modifying pom.xml files for Spark 2, Scala 2.12 release."

mvn --batch-mode \
  -P distribution \
  -Dresume=false \
  -Dtag=cannoli-parent-spark2_2.12-${release} \
  -DreleaseVersion=${release} \
  -DdevelopmentVersion=${devel} \
  -DbranchName=cannoli-spark2_2.12-${release} \
  release:clean \
  release:prepare \
  release:perform
{'fraction_non_alphanumeric': 0.1477467199087279, 'fraction_numerical': 0.0356531660011409, 'mean_word_length': 3.6205533596837944, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, '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': '784703', 'n_tokens_mistral': 1365, 'n_tokens_neox': 1258, 'n_words': 328}