You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
749 B

  1. #!/bin/bash
  2. #Update the release version of the project
  3. #version string will look similar to this: 0.1.0-DEV-27-060aec7
  4. VERSION=$(head -1 ./version.info)
  5. #do work on the version to get the correct info
  6. #we need the version string from above to look like this: 0.1.1-DEV
  7. IFS='.' read -a arr <<< "$VERSION"
  8. #results in [0,1,0-DEV-27-060aec7]
  9. IFS='-' read -a arr2 <<< "${arr[2]}"
  10. #results in [0,DEV,27,060aec7]
  11. MVERSIONTEMP=0
  12. #determine the milestone version
  13. if [ "${arr2[1]:0:1}" = "M" ]
  14. then
  15. MVERSIONTEMP=${arr2[1]:1}
  16. fi
  17. #increment the milestone vesrion
  18. let MVERSION=${MVERSIONTEMP}+1
  19. VERSION="${arr[0]}.${arr[1]}.${arr2[0]}-M$MVERSION"
  20. echo $VERSION
  21. #update the POM
  22. mvn versions:set -DnewVersion=$VERSION
  23. echo "$VERSION" > version.info