mirror of
https://github.com/anthonyraymond/joal.git
synced 2024-09-20 07:16:26 +08:00
update publish script
This commit is contained in:
parent
5f1aa8d99a
commit
a58ab74db5
50
publish.sh
50
publish.sh
|
@ -46,53 +46,3 @@ mvn versions:set -DnextSnapshot=true -DprocessAllModules=true -DgenerateBackupPo
|
||||||
git add pom.xml ./*/pom.xml && git commit -m "Prepare next iteration" && git push origin master
|
git add pom.xml ./*/pom.xml && git commit -m "Prepare next iteration" && git push origin master
|
||||||
|
|
||||||
shopt -u nullglob
|
shopt -u nullglob
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
versionPattern="[0-9]+\.[0-9]+\.[0-9]+(\-beta)*"
|
|
||||||
|
|
||||||
tagName=""
|
|
||||||
while [[ ! $tagName =~ $versionPattern ]]; do
|
|
||||||
read -p "Tag name (version): " tagName
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
if ! grep -Fq "<version>$tagName</version>" ./pom.xml; then
|
|
||||||
echo -e "$(tput setaf 1)WOW, wait! The provided tag does not match the pom.xml version$(tput sgr0)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if GIT_DIR=./.git git rev-parse $tagName >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
echo -e "$(tput setaf 1)ERROR: Tag $tagName already exists$(tput sgr0)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if git tag $tagName; then
|
|
||||||
echo -e "$(tput setaf 2)Tag created$(tput sgr0)"
|
|
||||||
else
|
|
||||||
echo -e "$(tput setaf 1)ERROR: Failed to create tag locally$(tput sgr0)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if git push origin $tagName; then
|
|
||||||
echo -e "$(tput setaf 2)Tag pushed$(tput sgr0)"
|
|
||||||
else
|
|
||||||
echo -e "$(tput setaf 1)ERROR: Failed to push tag$(tput sgr0)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "$(tput setaf 2)Everything went fine :)$(tput sgr0)"
|
|
||||||
|
|
Loading…
Reference in a new issue