[Project] created autoRelease.sh and added cleanup trap
This commit is contained in:
parent
e147594a9d
commit
852e230ca4
|
@ -40,7 +40,7 @@ if ! git fetch --all --tags > /dev/null ; then
|
||||||
echo -e "ERROR: Tags and branches could not be fetched!"
|
echo -e "ERROR: Tags and branches could not be fetched!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if git tag | grep ${hotfixVersion} > /dev/null ; then
|
if git tag | grep ${newVersion} > /dev/null ; then
|
||||||
echo -e "ERROR: Tag already exists!"
|
echo -e "ERROR: Tag already exists!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -82,7 +82,7 @@ fi
|
||||||
|
|
||||||
# set hotfix version
|
# set hotfix version
|
||||||
echo -e "\nINFO: Setting version..."
|
echo -e "\nINFO: Setting version..."
|
||||||
if ! mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${hotfixVersion} > /dev/null ; then
|
if ! mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${newVersion} > /dev/null ; then
|
||||||
echo -e "ERROR: Failed to set new version!"
|
echo -e "ERROR: Failed to set new version!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -102,30 +102,30 @@ if ! git add . ; then
|
||||||
echo -e "ERROR: Failed to git add"
|
echo -e "ERROR: Failed to git add"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! git commit -m "[Project] Set new version ${hotfixVersion}" ; then
|
if ! git commit -m "[Project] Set new version ${newVersion}" ; then
|
||||||
echo -e "ERROR: Failed to git commit"
|
echo -e "ERROR: Failed to git commit"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! git tag --sign --message "[Project] New Version ${hotfixVersion}" ${hotfixVersion} ; then
|
if ! git tag --sign --message "[Project] New Version ${newVersion}" ${newVersion} ; then
|
||||||
echo -e "ERROR: Failed to git tag"
|
echo -e "ERROR: Failed to git tag"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# git push
|
# git push
|
||||||
echo -e "\nINFO: Hotfix ${hotfixVersion} 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"
|
||||||
read a
|
read a
|
||||||
if [[ "${a}" == "y" || "${a}" == "Y" ]] ; then
|
if [[ "${a}" == "y" || "${a}" == "Y" ]] ; then
|
||||||
echo -e "INFO: Pushing to origin..."
|
echo -e "INFO: Pushing to origin..."
|
||||||
if ! git push origin ${hotfixVersion} ; then
|
if ! git push origin ${newVersion} ; then
|
||||||
echo -e "ERROR: Failed to push tag"
|
echo -e "ERROR: Failed to push tag"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo -e "\nINFO: Pushed hotfix tag ${hotfixVersion}"
|
echo -e "\nINFO: Pushed hotfix tag ${newVersion}"
|
||||||
else
|
else
|
||||||
echo -e "WARN: Release not pushed!"
|
echo -e "WARN: Release not pushed!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo -e "\nINFO: Hotfix ${hotfixVersion} created."
|
echo -e "\nINFO: Hotfix ${newVersion} created."
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue