[Project] also install to maven in autoRelease.sh

This commit is contained in:
Robert von Burg 2017-10-03 11:53:06 +02:00
parent 2c5dddd893
commit 91c231cdd7
1 changed files with 6 additions and 10 deletions

View File

@ -15,14 +15,12 @@ updateVersion=$(echo $lastTag | cut -d '.' -f 3)
newUpdateVersion=$((updateVersion+1))
newVersion="${majorVersion}.${minorVersion}.${newUpdateVersion}"
## Make sure no changes
if ! git diff-index --quiet HEAD -- ; then
echo "ERROR: You have unsaved changes."
exit 1
fi
# cleanup trap
function cleanup {
echo -e "\nINFO: Cleaning up..."
@ -32,7 +30,6 @@ function cleanup {
}
trap cleanup EXIT
# Confirm
echo -e "INFO: Previous tag: ${lastTag}"
echo -e "INFO: Do you want to create release ${newVersion} from release branch ${releaseBranch}? y/n"
@ -41,7 +38,6 @@ if [[ "${a}" != "y" && "${a}" != "Y" ]] ; then
exit 0;
fi
# validate tag does not exist
echo -e "INFO: Fetching tags and branches and validating they do not exist..."
if ! git fetch --all --tags > /dev/null ; then
@ -53,7 +49,6 @@ if git tag | grep ${newVersion} > /dev/null ; then
exit 1
fi
# make sure gpg-agent is available and loaded
echo -e "\nINFO: Searching for gpg-agent..."
if ! which gpg-agent ; then
@ -71,7 +66,6 @@ if ! gpg-agent 2>&1 | grep "running and available" ; then
fi
fi
# Checkout release branch
echo -e "\nINFO: Checking out release branch ${releaseBranch}"
if ! git checkout ${releaseBranch} ; then
@ -79,7 +73,6 @@ if ! git checkout ${releaseBranch} ; then
exit 1
fi
# create temp branch
echo -e "\nINFO: Creating temp branch..."
if ! git checkout -b temp ; then
@ -87,7 +80,6 @@ if ! git checkout -b temp ; then
exit 1
fi
# set hotfix version
echo -e "\nINFO: Setting version..."
if ! mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${newVersion} > /dev/null ; then
@ -95,7 +87,6 @@ if ! mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${newVersion} > /d
exit 1
fi
# build
echo -e "\nINFO: Doing a build with new version..."
if ! mvn clean package -DskipTests > /dev/null ; then
@ -103,7 +94,6 @@ if ! mvn clean package -DskipTests > /dev/null ; then
exit 1
fi
# commit to tag
echo -e "\nINFO: Creating tag..."
if ! git add . ; then
@ -119,6 +109,12 @@ if ! git tag --sign --message "[Project] New Version ${newVersion}" ${newVersion
exit 1
fi
# local install
echo -e "\nINFO: Installing new version..."
if ! mvn source:jar install -DskipTests > /dev/null ; then
echo -e "ERROR: Failed to install new version!"
exit 1
fi
# git push
echo -e "\nINFO: Hotfix ${newVersion} created. Do you want to push to origin? y/n"