#!/bin/bash
set -xe

PROJECT_PREFIX=`readlink -e ..`

$PROJECT_PREFIX/kit/apache-maven-3.3.9/bin/mvn -Dmaven.repo.local=$PROJECT_PREFIX/kit/m2 --settings $PROJECT_PREFIX/kit/m2/settings.xml --strict-checksums -o -DskipTests=true clean install
pushd storm-dist/binary

# The second build step will attempt to sign the distribution tarball it
# creates which serves no purpose for us. So let's make sure "signing"
# succeeds.
mkdir -p /tmp/bin
ln -sf /usr/bin/true /tmp/bin/gpg
PATH=/tmp/bin:$PATH

$PROJECT_PREFIX/kit/apache-maven-3.3.9/bin/mvn -Dmaven.repo.local=$PROJECT_PREFIX/kit/m2 --settings $PROJECT_PREFIX/kit/m2/settings.xml --strict-checksums -o -DskipTests=true package
popd
rm -rf /tmp/bin
