From a49f84ff14f53a80c28ed411102bf12864e02b65 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Sat, 25 Jan 2014 21:59:33 -0600 Subject: [PATCH] Generated a bunch of scripts for managing releases. --- DEVLOPMENT.md | 2 +- changeTagToDev.sh | 18 ++++++++++++++++++ changeTagToFinal.sh | 18 ++++++++++++++++++ changeTagToMilestone.sh | 26 ++++++++++++++++++++++++++ changeTagToSnapshot.sh | 18 ++++++++++++++++++ createBuildRelease.sh | 5 +++++ createMajorRelease.sh | 30 ++++++++++++++++++++++++++++++ createMinorRelease.sh | 30 ++++++++++++++++++++++++++++++ createPatchRelease.sh | 6 ++++++ createTestRelease.sh | 5 ----- 10 files changed, 152 insertions(+), 6 deletions(-) create mode 100755 changeTagToDev.sh create mode 100755 changeTagToFinal.sh create mode 100755 changeTagToMilestone.sh create mode 100755 changeTagToSnapshot.sh create mode 100755 createBuildRelease.sh create mode 100755 createMajorRelease.sh create mode 100755 createMinorRelease.sh delete mode 100755 createTestRelease.sh diff --git a/DEVLOPMENT.md b/DEVLOPMENT.md index ee1b35a..6706818 100644 --- a/DEVLOPMENT.md +++ b/DEVLOPMENT.md @@ -47,5 +47,5 @@ Image Tools is a mixed language project. Java provides the interface code and su Limited samples should be included in version control and ideally none should be included as they massively increase the repository size. Instead all samples required to run the tests should be provided as a seperate package to be downloaded by the developer for inclusion before running the tests. -Image Tools uses the Semantic Versioning scheme to represent changes within the code base. The initial version committed was v0.1.0-DEV. Tagged versions should follow this scheme. In addition to Semantic Versioning the follwing tags are used. DEV (indicates a development version, very unstable, may not pass all tests), SNAPSHOT (unstable versions, passes all tests but not all features may be ready fore release), M{number} i.e. M1 (sequential milestone release for a specific version number. This build is 'expected' to be stable, but may not be completely stable. All tests pass and are consistent on known platforms.), FINAL (last supported version of a major.minor pair. No more updates will be released along this line and upgrading to a newer major.minor pair is advised. Typically used when deprecated functionality is cut off.) If no tag is included it is safe to assume it is a production version and has made it out of milestone , but has not yet reached FINAL so more revision changes may occur as bugs are fixed. +Image Tools uses the Semantic Versioning scheme to represent changes within the code base. The initial version committed was v0.1.0-DEV. Tagged versions should follow this scheme. In addition to Semantic Versioning the follwing tags are used. DEV (indicates a development version, very unstable, may not pass all tests), SNAPSHOT (unstable versions, passes all tests but not all features may be ready for release), M{number} i.e. M1 (sequential milestone release for a specific version number. This build is 'expected' to be stable, but may not be completely stable. All tests pass and are consistent on known platforms.), FINAL (last supported version of a major.minor pair. No more updates will be released along this line and upgrading to a newer major.minor pair is advised. Typically used when deprecated functionality is cut off.) If no tag is included it is safe to assume it is a production version and has made it out of milestone , but has not yet reached FINAL so more revision changes may occur as bugs are fixed. diff --git a/changeTagToDev.sh b/changeTagToDev.sh new file mode 100755 index 0000000..4f19328 --- /dev/null +++ b/changeTagToDev.sh @@ -0,0 +1,18 @@ +#!/bin/bash +#Update the release version of the project +#version string will look similar to this: 0.1.0-DEV-27-060aec7 +VERSION=$(head -1 ./version.info) + +#do work on the version to get the correct info +#we need the version string from above to look like this: 0.1.1-DEV +IFS='.' read -a arr <<< "$VERSION" +#results in [0,1,0-DEV-27-060aec7] +IFS='-' read -a arr2 <<< "${arr[2]}" +#results in [0,DEV,27,060aec7] +VERSION="${arr[0]}.${arr[1]}.${arr2[0]}-DEV" +#echo $VERSION + +#update the POM +mvn versions:set -DnewVersion=$VERSION + +echo "$VERSION" > version.info \ No newline at end of file diff --git a/changeTagToFinal.sh b/changeTagToFinal.sh new file mode 100755 index 0000000..4f19328 --- /dev/null +++ b/changeTagToFinal.sh @@ -0,0 +1,18 @@ +#!/bin/bash +#Update the release version of the project +#version string will look similar to this: 0.1.0-DEV-27-060aec7 +VERSION=$(head -1 ./version.info) + +#do work on the version to get the correct info +#we need the version string from above to look like this: 0.1.1-DEV +IFS='.' read -a arr <<< "$VERSION" +#results in [0,1,0-DEV-27-060aec7] +IFS='-' read -a arr2 <<< "${arr[2]}" +#results in [0,DEV,27,060aec7] +VERSION="${arr[0]}.${arr[1]}.${arr2[0]}-DEV" +#echo $VERSION + +#update the POM +mvn versions:set -DnewVersion=$VERSION + +echo "$VERSION" > version.info \ No newline at end of file diff --git a/changeTagToMilestone.sh b/changeTagToMilestone.sh new file mode 100755 index 0000000..914b054 --- /dev/null +++ b/changeTagToMilestone.sh @@ -0,0 +1,26 @@ +#!/bin/bash +#Update the release version of the project +#version string will look similar to this: 0.1.0-DEV-27-060aec7 +VERSION=$(head -1 ./version.info) + +#do work on the version to get the correct info +#we need the version string from above to look like this: 0.1.1-DEV +IFS='.' read -a arr <<< "$VERSION" +#results in [0,1,0-DEV-27-060aec7] +IFS='-' read -a arr2 <<< "${arr[2]}" +#results in [0,DEV,27,060aec7] +MVERSIONTEMP=0 +#determine the milestone version +if [ "${arr2[1]:0:1}" = "M" ] + then + MVERSIONTEMP=${arr2[1]:1} +fi +#increment the milestone vesrion +let MVERSION=${MVERSIONTEMP}+1 +VERSION="${arr[0]}.${arr[1]}.${arr2[0]}-M$MVERSION" +echo $VERSION + +#update the POM +mvn versions:set -DnewVersion=$VERSION + +echo "$VERSION" > version.info \ No newline at end of file diff --git a/changeTagToSnapshot.sh b/changeTagToSnapshot.sh new file mode 100755 index 0000000..6e43f84 --- /dev/null +++ b/changeTagToSnapshot.sh @@ -0,0 +1,18 @@ +#!/bin/bash +#Update the release version of the project +#version string will look similar to this: 0.1.0-DEV-27-060aec7 +VERSION=$(head -1 ./version.info) + +#do work on the version to get the correct info +#we need the version string from above to look like this: 0.1.1-DEV +IFS='.' read -a arr <<< "$VERSION" +#results in [0,1,0-DEV-27-060aec7] +IFS='-' read -a arr2 <<< "${arr[2]}" +#results in [0,DEV,27,060aec7] +VERSION="${arr[0]}.${arr[1]}.${arr2[0]}-SNAPSHOT" +#echo $VERSION + +#update the POM +mvn versions:set -DnewVersion=$VERSION + +echo "$VERSION" > version.info \ No newline at end of file diff --git a/createBuildRelease.sh b/createBuildRelease.sh new file mode 100755 index 0000000..28b5b9f --- /dev/null +++ b/createBuildRelease.sh @@ -0,0 +1,5 @@ +#!/bin/bash +#Do not change versions as this is a build release with artifacts +#Build and package the current version +. build.sh +. package.sh diff --git a/createMajorRelease.sh b/createMajorRelease.sh new file mode 100755 index 0000000..018b0ab --- /dev/null +++ b/createMajorRelease.sh @@ -0,0 +1,30 @@ +#!/bin/bash +#Update the release version of the project +#version string will look similar to this: 0.1.0-DEV-27-060aec7 +VERSION=$(head -1 ./version.info) + +#do work on the version to get the correct info +#we need the version string from above to look like this: 0.1.1-DEV +IFS='.' read -a arr <<< "$VERSION" +#results in [0,1,0-DEV-27-060aec7] +IFS='-' read -a arr2 <<< "${arr[2]}" +#results in [0,DEV,27,060aec7] +let major=${arr[0]}+1 +#echo $major +VERSION="$major.0.0-${arr2[1]}" +#echo $VERSION + +#update the POM +mvn versions:set -DnewVersion=$VERSION + +#commit the new patch version +git commit -a . -m "Creating major version $VERSION" + +#tag the build +git tag -a v$VERSION -m "Major Release Version $VERSION" + +#push the build and tag +git push --follow-tags + +. build.sh +. package.sh diff --git a/createMinorRelease.sh b/createMinorRelease.sh new file mode 100755 index 0000000..7fd161c --- /dev/null +++ b/createMinorRelease.sh @@ -0,0 +1,30 @@ +#!/bin/bash +#Update the release version of the project +#version string will look similar to this: 0.1.0-DEV-27-060aec7 +VERSION=$(head -1 ./version.info) + +#do work on the version to get the correct info +#we need the version string from above to look like this: 0.1.1-DEV +IFS='.' read -a arr <<< "$VERSION" +#results in [0,1,0-DEV-27-060aec7] +IFS='-' read -a arr2 <<< "${arr[2]}" +#results in [0,DEV,27,060aec7] +let minor=${arr[1]}+1 +#echo $minor +VERSION="${arr[0]}.$minor.0-${arr2[1]}" +#echo $VERSION + +#update the POM +mvn versions:set -DnewVersion=$VERSION + +#commit the new patch version +git commit -a . -m "Creating minor version $VERSION" + +#tag the build +git tag -a v$VERSION -m "Minor Release Version $VERSION" + +#push the build and tag +git push --follow-tags + +. build.sh +. package.sh diff --git a/createPatchRelease.sh b/createPatchRelease.sh index 5a63860..30748d8 100755 --- a/createPatchRelease.sh +++ b/createPatchRelease.sh @@ -17,8 +17,14 @@ VERSION="${arr[0]}.${arr[1]}.$patch-${arr2[1]}" #update the POM mvn versions:set -DnewVersion=$VERSION +#commit the new patch version +git commit -a . -m "Creating patch version $VERSION" + #tag the build git tag -a v$VERSION -m "Patch Release Version $VERSION" +#push the build and tag +git push --follow-tags + . build.sh . package.sh diff --git a/createTestRelease.sh b/createTestRelease.sh deleted file mode 100755 index ee64d5f..0000000 --- a/createTestRelease.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -#Do not change versions as this is a test build with artifacts -#Build and package the current version -. build.sh -. package.sh \ No newline at end of file