2018-09-06 14:44:17 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
printf "\nnote: follow the guides in MAINTAINERS.md to setup notary delegation (Docker) and get sonatype key (Maven) \n"
|
|
|
|
|
|
|
|
DIR=$( cd $(dirname $0) ; pwd -P )
|
|
|
|
|
|
|
|
# gpg sbt plugin fails if this is not set
|
|
|
|
export GPG_TTY=$(tty)
|
|
|
|
|
|
|
|
##
|
2019-10-30 07:04:11 -04:00
|
|
|
# running tests
|
2018-09-06 14:44:17 -04:00
|
|
|
##
|
2019-10-30 07:04:11 -04:00
|
|
|
if [ "$1" != "skip-tests" ]; then
|
|
|
|
# Checking for uncommitted changes
|
|
|
|
printf "\nchecking for uncommitted changes... \n"
|
|
|
|
if ! (cd "$DIR" && git add . && git diff-index --quiet HEAD --)
|
|
|
|
then
|
|
|
|
printf "\nerror: attempting to release with uncommitted changes\n"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
# If we are not in the main repository then fail fast
|
|
|
|
REMOTE_REPO=$(git config --get remote.origin.url)
|
|
|
|
echo "REMOTE REPO IS $REMOTE_REPO"
|
|
|
|
if [[ "$REMOTE_REPO" != *-vinyldns/vinyldns.git ]]; then
|
|
|
|
printf "\nCannot run a release from this repository as it is not the main repository: $REMOTE_REPO \n"
|
2018-09-06 14:44:17 -04:00
|
|
|
exit 1
|
2019-10-30 07:04:11 -04:00
|
|
|
fi
|
2018-09-06 14:44:17 -04:00
|
|
|
|
2019-10-30 07:04:11 -04:00
|
|
|
# If we are not on the master branch,then fail fast
|
|
|
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
if [[ "$BRANCH" != "master" ]]; then
|
|
|
|
printf "\nCannot run a release from this branch: $BRANCH is not master \n"
|
|
|
|
exit 1;
|
|
|
|
fi
|
2018-09-06 14:44:17 -04:00
|
|
|
|
2019-10-30 07:04:11 -04:00
|
|
|
printf "\nrunning api func tests... \n"
|
|
|
|
"$DIR"/remove-vinyl-containers.sh
|
|
|
|
if ! "$DIR"/func-test-api.sh
|
|
|
|
then
|
|
|
|
printf "\nerror: bin/func-test-api.sh failed \n"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
"$DIR"/remove-vinyl-containers.sh
|
2018-09-06 14:44:17 -04:00
|
|
|
|
2019-10-30 07:04:11 -04:00
|
|
|
printf "\nrunning portal func tests... \n"
|
|
|
|
if ! "$DIR"/func-test-portal.sh
|
|
|
|
then
|
|
|
|
printf "\nerror: bin/func-test-portal.sh failed \n"
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-09-06 14:44:17 -04:00
|
|
|
|
2019-10-30 07:04:11 -04:00
|
|
|
printf "\nrunning verify... \n"
|
|
|
|
if ! "$DIR"/verify.sh
|
|
|
|
then
|
|
|
|
printf "\nerror: bin/verify.sh failed \n"
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-09-06 14:44:17 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
##
|
|
|
|
# run release
|
|
|
|
##
|
2019-10-30 07:04:11 -04:00
|
|
|
cd "$DIR"/../ && sbt release && cd $DIR
|
2018-09-06 14:44:17 -04:00
|
|
|
|
|
|
|
printf "\nrelease finished \n"
|