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