Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function releaseApp {
- echo 'Go to develop and update...'
- cd $BASE_PATH$1
- git pull --rebase
- echo 'Go to master and update...'
- git checkout master
- git pull --rebase
- echo 'Up master version...'
- mvn org.codehaus.mojo:versions-maven-plugin:2.1:update-parent org.codehaus.mojo:versions-maven-plugin:2.1:set org.codehaus.mojo:versions-maven-plugin:2.1:commit -DnewVersion=$MASTER_VERSION
- git commit -am 'Release '$MASTER_VERSION' - podbicie wersji'
- echo 'Finish release '$MASTER_VERSION' ...'
- git checkout 'release'$BRANCH_SEPARATOR$MASTER_VERSION
- git flow release finish -F -p -m 'new_tag' $MASTER_VERSION
- echo 'Autosolve conflicts on master...'
- grep -lr "<<<<<<<" . | xargs git checkout --ours
- git commit -am 'Merge release z master- rozwiazanie konfliktow'
- git flow release finish -F -p -m 'new_tag' $MASTER_VERSION
- echo 'Autosolve conflicts on develop...'
- git checkout develop
- grep -lr "<<<<<<<" . | xargs git checkout --ours
- git commit -m 'Merge release z develop- rozwiazanie konfliktow'
- git add -A
- git flow release finish -F -p -m 'new_tag' $MASTER_VERSION
- echo 'Start and publish new release...'
- git flow release start $NEW_RELEASE_VERSION
- git flow release publish $NEW_RELEASE_VERSION
- echo 'Up develop version...'
- git checkout develop
- mvn org.codehaus.mojo:versions-maven-plugin:2.1:update-parent org.codehaus.mojo:versions-maven-plugin:2.1:set org.codehaus.mojo:versions-maven-plugin:2.1:commit -DnewVersion=$NEW_DEV_VERSION'-SNAPSHOT'
- git commit -am "Podbicie wersji develop"
- git push origin develop
- }
- function validateParams {
- if [ "$1" = '' ] ; then
- echo 'First parameter should be MASTER_VERSION ex. 51...'
- exit 0
- fi
- if [ "$2" != "-" ] && [ "$2" != "/" ] ; then
- echo 'Second parameter should be separator "-" or "/"'
- exit 0
- fi
- }
- #to not display merge message editor
- export GIT_MERGE_AUTOEDIT=no
- BASE_PATH='/Users/piotrkorlaga/Development/Source/'
- DIRS=('umk-seup-integration')
- BRANCH_SEPARATOR=$2
- VERSION=$1
- validateParams $VERSION $BRANCH_SEPARATOR
- MASTER_VERSION=0.$1.0
- NEW_RELEASE_VERSION=0.$(($1+1)).0
- NEW_DEV_VERSION=0.$(($1+2)).0
- echo 'Master version: '$MASTER_VERSION
- echo 'New release version: '$NEW_RELEASE_VERSION
- echo 'New dev version: '$NEW_DEV_VERSION
- echo 'Separator: '$BRANCH_SEPARATOR
- ELEMENTS=${#DIRS[@]}
- for (( i=0;i<$ELEMENTS;i++)); do
- releaseApp ${DIRS[${i}]}
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement