Skip to content
Snippets Groups Projects
Commit b2a598da authored by OZGCloud's avatar OZGCloud
Browse files

add release sripts

parent 2e5731b8
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Aufruf: ozg-release-erstellen.sh JA"
echo "Als Parameter bitte 'JA' eintragen zur Sicherheit"
exit 1
fi
## alle -SNAPSHOT in pom.xmls entfernen
SED_PARAMS="-i"
if [[ "$OSTYPE" =~ ^darwin ]]; then
SED_PARAMS="$SED_PARAMS '' -e"
fi
find . -name pom.xml -exec sed $SED_PARAMS 's/-SNAPSHOT//g' {} +
## release version auslesen
NEWVERSION=$(xmlstarlet sel -N w="http://maven.apache.org/POM/4.0.0" -t -v '//w:project/w:version' -n pom.xml)
echo
echo "NEXT STEPS:"
echo "***********"
echo "Änderungen prüfen"
echo "git commit -a -m 'release version "$NEWVERSION"'"
echo "git push"
echo "git tag "$NEWVERSION
echo "git push --tags"
#!/bin/bash
#set -x
if [ "$#" -ne 1 ]; then
echo "Aufruf: ozg-release-startdev.sh NEWVERSION"
exit 1
fi
NEWVERSION=$1
echo
# pom.xml:main -> project.version setzen
# projectname/pom.xml:parent -> project.parent.version setzen
# projectname/pom.xml:parent,main -> project.parent.version und project.version setzen
#
PROJECTS="pom.xml:main
"
for PROJECT in $PROJECTS;
do
POMFILE=$(echo $PROJECT | cut -d':' -f1)
ACTIONS=$(echo $PROJECT | cut -d':' -f2)
## Auf SNAPSHOT Versionen testen
if fgrep -q "SNAPSHOT" $POMFILE; then
RED='\033[0;31m'
NC='\033[0m'
echo "${RED}ERROR: Datei "$POMFILE" enthält noch SNAPSHOT Versionen, das sollte hier nicht passieren.${NC}"
exit 1
fi
echo $ACTIONS
## Versionen setzen
if [[ $ACTIONS == "main" ]] ; then
xmlstarlet ed --pf -L -N w="http://maven.apache.org/POM/4.0.0" -u '//w:project/w:version' -v $NEWVERSION $POMFILE
fi
if [[ $ACTIONS == "parent" ]]; then
xmlstarlet ed --pf -L -N w="http://maven.apache.org/POM/4.0.0" -u '//w:project/w:parent/w:version' -v $NEWVERSION $POMFILE
fi
done
echo
echo "NEXT STEPS:"
echo "***********"
echo "Änderungen prüfen"
echo "git commit -a -m 'start development "$NEWVERSION"'"
echo "git push"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment