Repository: usergrid
Updated Branches:
  refs/heads/master 93b864fe0 -> e83897bf6


Copy in release scripts from 2.1.0 release.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/e83897bf
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/e83897bf
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/e83897bf

Branch: refs/heads/master
Commit: e83897bf642e4588d781b527b3c5a57423a7741c
Parents: 93b864f
Author: Dave Johnson <[email protected]>
Authored: Tue Feb 23 09:38:07 2016 -0500
Committer: Dave Johnson <[email protected]>
Committed: Tue Feb 23 09:38:07 2016 -0500

----------------------------------------------------------------------
 release/binary-release.sh            | 10 +++-
 release/pom.xml                      |  2 +-
 release/release-candidate.sh         | 62 ++++++++++++++++++++---
 release/release.sh                   | 84 ++++++++++++++++++++++++-------
 release/src/main/assembly/binary.xml | 27 +++++-----
 5 files changed, 146 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/e83897bf/release/binary-release.sh
----------------------------------------------------------------------
diff --git a/release/binary-release.sh b/release/binary-release.sh
index 9886711..390a135 100755
--- a/release/binary-release.sh
+++ b/release/binary-release.sh
@@ -17,6 +17,13 @@
 # limitations under the License.
 #---------------------------------------------------------------------------
 
+if [[ $# < "1" ]]; then
+    echo "Must specify version on command line"
+    exit -1;
+fi
+
+echo "Building binary distribution using version" $1
+
 # Attempt to build Java SDK, Portal, Stack and Tools
 
 pushd ../sdks/java
@@ -34,4 +41,5 @@ mvn -DskipTests=true clean install
 popd
 
 # assemble binary release
-#mvn clean install
+mvn -DreleaseVersion=$1 clean install
+

http://git-wip-us.apache.org/repos/asf/usergrid/blob/e83897bf/release/pom.xml
----------------------------------------------------------------------
diff --git a/release/pom.xml b/release/pom.xml
index c40e8c2..8c558a9 100644
--- a/release/pom.xml
+++ b/release/pom.xml
@@ -28,7 +28,7 @@
 
     <groupId>org.apache.usergrid</groupId>
     <artifactId>apache-usergrid</artifactId>
-    <version>2.1.0</version>
+    <version>${releaseVersion}</version>
     <packaging>pom</packaging>
 
     <name>Apache Usergrid Binary Release</name>

http://git-wip-us.apache.org/repos/asf/usergrid/blob/e83897bf/release/release-candidate.sh
----------------------------------------------------------------------
diff --git a/release/release-candidate.sh b/release/release-candidate.sh
index 684eef6..969ac83 100755
--- a/release/release-candidate.sh
+++ b/release/release-candidate.sh
@@ -28,7 +28,6 @@
 # candidate which will need to be sent to the dev@ and private@ mailing lists.
 #
 
-# for the 2.1.0 release, we will release from 'release' instead of the usual 
'master'
 export RELEASE_BRANCH=release
 
 set -o errexit
@@ -38,6 +37,10 @@ rc_tag_version=0
 usergrid_git_web_url='https://git-wip-us.apache.org/repos/asf?p=usergrid.git'
 usergrid_svn_dist_url='https://dist.apache.org/repos/dist/dev/usergrid'
 
+
+#----------------------------------------------------------------------------------
+# Process command line arguments
+
 function print_help_and_exit {
 cat <<EOF
 Apache Usergrid release candidate tool.
@@ -89,6 +92,10 @@ if [[ "${1:-dry-run}" == "publish" ]]; then
   publish=1
 fi
 
+
+#----------------------------------------------------------------------------------
+# Make sure repo is latest and clean
+
 # Update local repository
 git fetch --all -q
 git fetch --tags -q
@@ -110,7 +117,10 @@ if [[ "$base_dir" != "$PWD" ]]; then
   cd $base_dir
 fi
 
+
+#----------------------------------------------------------------------------------
 # Calculate the new version string
+
 current_version=$(cat .usergridversion | tr '[a-z]' '[A-Z]')
 if ! [[ $current_version =~ .*-SNAPSHOT ]]; then
   echo "ERROR: .usergridversion is required to contain 'SNAPSHOT', it is 
${current_version}"
@@ -136,7 +146,10 @@ else
   new_snapshot_version="${new_master_version}-SNAPSHOT"
 fi
 
+
+#----------------------------------------------------------------------------------
 # Add the rc tag to the current version
+
 current_version_tag="${current_version}-rc${rc_tag_version}"
 
 # Make sure the branch does not exist
@@ -157,6 +170,10 @@ To roll back your local repo you will need to run:
 EOF
 }
 
+
+#----------------------------------------------------------------------------------
+# Make sure repo is clean, then branch
+
 # If anything goes wrong from here then print roll back instructions before 
exiting.
 function print_rollback_instructions {
   echo "ERROR: Looks like something has failed while creating the release 
candidate."
@@ -175,7 +192,10 @@ git clean -fdxq
 echo "Creating ${current_version_tag} branch"
 git branch $current_version_tag $(git rev-parse HEAD)
 
+
+#----------------------------------------------------------------------------------
 # Build the source distribution from the new branch
+
 echo "Checking out ${current_version_tag} branch and updating .usergridversion"
 git checkout $current_version_tag
 # Increment the version and create a branch
@@ -190,22 +210,46 @@ dist_name="apache-usergrid-${current_version_tag}"
 mkdir -p ${dist_dir}
 git archive --prefix=${dist_name}/ -o ${dist_dir}/${dist_name}.tar.gz HEAD
 
+
+#----------------------------------------------------------------------------------
+# Create the binary release
+
+binary_name="apache-usergrid-${current_version_tag}-binary"
+
+pushd release
+./binary-release.sh ${current_version_tag}
+cp target/${binary_name}.tar.gz ${dist_dir}
+popd 
+
+
+#----------------------------------------------------------------------------------
+# Sign the tarballs
+
 cd ${dist_dir}
-# Sign the tarball.
+
 echo "Signing the distribution"
+
 gpg --armor --output ${dist_dir}/${dist_name}.tar.gz.asc --detach-sig 
${dist_dir}/${dist_name}.tar.gz
+gpg --armor --output ${dist_dir}/${binary_name}.tar.gz.asc --detach-sig 
${dist_dir}/${binary_name}.tar.gz
 
-# Create the checksums
 echo "Creating checksums"
+
 gpg --print-md MD5 ${dist_name}.tar.gz > ${dist_name}.tar.gz.md5
+gpg --print-md MD5 ${binary_name}.tar.gz > ${binary_name}.tar.gz.md5
+
 shasum ${dist_name}.tar.gz > ${dist_name}.tar.gz.sha
+shasum ${binary_name}.tar.gz > ${binary_name}.tar.gz.sha
+
 
+#----------------------------------------------------------------------------------
 # Publish release candidate to svn and commit and push the new git branch
+
 if [[ $publish == 1 ]]; then
   echo "Publishing release candidate to 
${usergrid_svn_dist_url}/${current_version_tag}"
   svn mkdir ${usergrid_svn_dist_url}/${current_version_tag} -m 
"usergrid-${current_version} release candidate ${rc_tag_version}"
   svn co --depth=empty ${usergrid_svn_dist_url}/${current_version_tag} 
${dist_dir}
   svn add ${dist_name}*
+  svn add ${binary_name}*
   svn ci -m "usergrid-${current_version} release candidate ${rc_tag_version}"
 
   echo "Pushing new branch ${current_version_tag} to origin"
@@ -220,11 +264,14 @@ cd ${base_dir}
 
 current_commit_id=`git rev-parse HEAD`
 
+
+#----------------------------------------------------------------------------------
+# Create the email for the release candidate to be sent to the mailing lists.
+
 echo "Done creating the release candidate. The following draft email has been 
created"
 echo "to send to the [email protected] mailing list"
 echo
 
-# Create the email template for the release candidate to be sent to the 
mailing lists.
 if [[ $(uname) == Darwin ]]; then
   vote_end=$(date -v+3d)
 else
@@ -253,12 +300,15 @@ The current Git commit ID is ${current_commit_id}
 
 The release candidate is available at:
 ${usergrid_svn_dist_url}/${current_version_tag}/${dist_name}.tar.gz
+${usergrid_svn_dist_url}/${current_version_tag}/${binary_name}.tar.gz
 
 The MD5 checksum of the release candidate can be found at:
 ${usergrid_svn_dist_url}/${current_version_tag}/${dist_name}.tar.gz.md5
+${usergrid_svn_dist_url}/${current_version_tag}/${binary_name}.tar.gz.md5
 
 The signature of the release candidate can be found at:
 ${usergrid_svn_dist_url}/${current_version_tag}/${dist_name}.tar.gz.asc
+${usergrid_svn_dist_url}/${current_version_tag}/${binary_name}.tar.gz.asc
 
 The GPG key used to sign the release are available at:
 ${usergrid_svn_dist_url}/KEYS
@@ -274,11 +324,11 @@ The vote will close on ${vote_end}
 __EOF__
 )
 
-echo 
"--------------------------------------------------------------------------------"
+echo 
"-----------------------------------------------------------------------------"
 echo
 echo "${MESSAGE}"
 echo
-echo 
"--------------------------------------------------------------------------------"
+echo 
"-----------------------------------------------------------------------------"
 echo
 
 # Print reset instructions if this was a dry-run

http://git-wip-us.apache.org/repos/asf/usergrid/blob/e83897bf/release/release.sh
----------------------------------------------------------------------
diff --git a/release/release.sh b/release/release.sh
index acc3b1a..7cfc5cd 100755
--- a/release/release.sh
+++ b/release/release.sh
@@ -19,7 +19,6 @@
 # This script is used to publish the official release after a successful
 # vote of a release-candidate.
 
-# for the 2.1.0 release, we will release from 'release' instead of the usual 
'master'
 export RELEASE_BRANCH=release
 
 set -e
@@ -30,6 +29,10 @@ 
usergrid_git_web_url='https://git-wip-us.apache.org/repos/asf?p=usergrid.git'
 usergrid_svn_dist_url='https://dist.apache.org/repos/dist/release/usergrid'
 usergrid_svn_dev_dist_url='https://dist.apache.org/repos/dist/dev/usergrid'
 
+
+#---------------------------------------------------------------------------------
+# Process command line arguments
+
 function print_help_and_exit {
 cat <<EOF
 Apache Usergrid release tool.
@@ -68,6 +71,10 @@ if [[ "${1:-dry-run}" == "publish" ]]; then
   publish=1
 fi
 
+
+#----------------------------------------------------------------------------------
+# Make sure we have signing key and repo is latest and clean
+
 # Update local repository
 git fetch --all -q
 git fetch --tags -q
@@ -94,8 +101,8 @@ base_dir=$(git rev-parse --show-toplevel)
 if [[ -n "`git status --porcelain`" ]]; then
   echo "ERROR: Please run from a clean $RELEASE_BRANCH"
   exit 1
-elif [[ "`git rev-parse --abbrev-ref HEAD`" == "$RELEASE_BRANCH" ]]; then
-  echo "ERROR: This script must be run from the released branch."
+elif [[ "`git rev-parse --abbrev-ref HEAD`" != $RELEASE_BRANCH ]]; then
+  echo "ERROR: This script must be run from the ${RELEASE_BRANCH} branch."
   exit 1
 fi
 
@@ -104,6 +111,10 @@ if [[ "$base_dir" != "$PWD" ]]; then
   cd $base_dir
 fi
 
+
+#----------------------------------------------------------------------------------
+# Calculate the new version string
+
 # Make sure that this is not on a snapshot release
 tagged_version=$(cat .usergridversion | tr '[a-z]' '[A-Z]')
 current_version=$tagged_version
@@ -129,19 +140,31 @@ if [[ $publish == 0 ]]; then
   echo "Performing dry-run"
 fi
 
+
+#----------------------------------------------------------------------------------
 # Create a branch for the release and update the .usergridversion and tag it
+
 echo "Creating release branch and tag for ${current_version}"
 git checkout -b $current_version
-echo $current_version > .usergridversion
-git add .usergridversion
-git commit -m "Updating .usergridversion to ${current_version}."
 
-git tag -s "${current_version}" -m "usergrid-${current_version} release." 
$current_version
+# don't need this, the usergridversion is already up to date
+#echo $current_version > .usergridversion
+#git add .usergridversion
+#git commit -m "Updating .usergridversion to ${current_version}."
 
-#if [[ $publish == 1 ]]; then
-  #git push origin $current_version
-  #git push origin --tags
-#fi
+
+# TODO: ensure that the tag has the same date as the last commit made
+
+git tag -s "usergrid-${current_version}" -m "usergrid-${current_version} 
release." $current_version
+
+if [[ $publish == 1 ]]; then
+  git push origin $current_version
+  git push origin --tags
+fi
+
+
+#----------------------------------------------------------------------------------
+# Build the source distribution from the new branch
 
 dist_name="apache-usergrid-${current_version}"
 
@@ -150,29 +173,49 @@ release_dir=${dist_dir}/${current_version}
 mkdir -p $release_dir
 cd $dist_dir
 
-#if [[ $publish == 1 ]]; then
-#  echo "Publishing the release"
+if [[ $publish == 1 ]]; then
+  echo "Publishing the release"
   # Make and checkout the release dist directory
-#  svn mkdir ${usergrid_svn_dist_url}/${current_version} -m 
"usergrid-${current_version} release"
-#  svn co --depth=empty ${usergrid_svn_dist_url}/${current_version} 
${release_dir}
-#fi
+  svn mkdir ${usergrid_svn_dist_url}/${current_version} -m 
"usergrid-${current_version} release"
+  svn co --depth=empty ${usergrid_svn_dist_url}/${current_version} 
${release_dir}
+fi
 
-# Now that the .usergridversion has been updated to the release version build 
the release source dist from it
+# Now that the .usergridversion has been updated to the release version build 
+# the release source dist from it
 cd $base_dir
 git archive --prefix=${dist_name}/ -o ${release_dir}/${dist_name}.tar.gz HEAD
 
+
+#----------------------------------------------------------------------------------
+# Build the binary distribution from the new branch
+
+binary_name="apache-usergrid-${current_version}-binary"
+
+pushd release
+./binary-release.sh ${current_version}
+cp target/${binary_name}.tar.gz ${release_dir}
+popd 
+
+
+#----------------------------------------------------------------------------------
+# Sign the tarballs
+
 cd ${release_dir}
-# Sign the tarball.
+
 echo "Signing the distribution"
 gpg --armor --output ${release_dir}/${dist_name}.tar.gz.asc --detach-sig 
${release_dir}/${dist_name}.tar.gz
 
-# Create the checksums
 echo "Creating checksums"
+
 # md5
 gpg --print-md MD5 ${dist_name}.tar.gz > ${dist_name}.tar.gz.md5
+gpg --print-md MD5 ${binary_name}.tar.gz > ${binary_name}.tar.gz.md5
+
 # sha
 shasum ${dist_name}.tar.gz > ${dist_name}.tar.gz.sha
+shasum ${binary_name}.tar.gz > ${binary_name}.tar.gz.sha
 
+# do this part by hand for now:
 #if [[ $publish == 1 ]]; then
   # Commit the release
 #  svn add .
@@ -224,12 +267,15 @@ The current Git commit ID is ${current_commit_id}
 
 The release is available at:
 ${usergrid_svn_dist_url}/${current_version}/${dist_name}.tar.gz
+${usergrid_svn_dist_url}/${current_version}/${binary_name}.tar.gz
 
 The MD5 checksum of the release can be found at:
 ${usergrid_svn_dist_url}/${current_version}/${dist_name}.tar.gz.md5
+${usergrid_svn_dist_url}/${current_version}/${binary_name}.tar.gz.md5
 
 The signature of the release can be found at:
 ${usergrid_svn_dist_url}/${current_version}/${dist_name}.tar.gz.asc
+${usergrid_svn_dist_url}/${current_version}/${binary_name}.tar.gz.asc
 
 The GPG key used to sign the release are available at:
 ${usergrid_svn_dist_url}/KEYS

http://git-wip-us.apache.org/repos/asf/usergrid/blob/e83897bf/release/src/main/assembly/binary.xml
----------------------------------------------------------------------
diff --git a/release/src/main/assembly/binary.xml 
b/release/src/main/assembly/binary.xml
index bf37d8a..16fffa3 100644
--- a/release/src/main/assembly/binary.xml
+++ b/release/src/main/assembly/binary.xml
@@ -21,47 +21,50 @@
 <assembly>
     <id>binary</id>
     <formats>
-        <format>zip</format>
         <format>tar.gz</format>
     </formats>
     <includeBaseDirectory>false</includeBaseDirectory>
 
+    <!-- Include individual files -->
+
     <files>
         
         <!-- Legal and Documentation -->
         <file>
             <source>../CHANGELOG</source>
-            
<outputDirectory>${artifact.artifactId}-${artifact.version}</outputDirectory>
+            
<outputDirectory>${artifact.artifactId}-${releaseVersion}</outputDirectory>
         </file> 
         <file>
             <source>../LICENSE</source>
-            
<outputDirectory>${artifact.artifactId}-${artifact.version}</outputDirectory>
+            
<outputDirectory>${artifact.artifactId}-${releaseVersion}</outputDirectory>
         </file> 
         <file>
             <source>../NOTICE</source>
-            
<outputDirectory>${artifact.artifactId}-${artifact.version}</outputDirectory>
+            
<outputDirectory>${artifact.artifactId}-${releaseVersion}</outputDirectory>
         </file> 
         
         <!-- Stack -->
         <file>
             <source>../stack/rest/target/ROOT.war</source>
-            
<outputDirectory>${artifact.artifactId}-${artifact.version}/stack</outputDirectory>
+            
<outputDirectory>${artifact.artifactId}-${releaseVersion}/stack</outputDirectory>
         </file>
         
-        <!-- Tools -->
+       <!-- Tools adds about 100mb to the download so let's omit it for now.
         <file>
-            
<source>../stack/tools/target/usergrid-tools-2.1.0-SNAPSHOT.jar</source>
-            
<outputDirectory>${artifact.artifactId}-${artifact.version}/tools</outputDirectory>
-        </file>
+            
<source>../stack/tools/target/usergrid-tools-2.1.1-SNAPSHOT.jar</source>
+            
<outputDirectory>${artifact.artifactId}-${releaseVersion}/tools</outputDirectory>
+        </file> -->
         
     </files>
 
+    <!-- Include Portal and SDK directory trees -->
+
     <fileSets>
 
         <!-- Portal and source (HTML5/JavaScript and Angular) -->
         <fileSet>
             <directory>../portal</directory>
-            
<outputDirectory>${artifact.artifactId}-${artifact.version}/portal</outputDirectory>
+            
<outputDirectory>${artifact.artifactId}-${releaseVersion}/portal</outputDirectory>
             <excludes>
                 <exclude>%ant[**/.idea/**]</exclude>
                 <exclude>%ant[**/node_modules/**]</exclude>
@@ -74,7 +77,7 @@
         <!-- HTML5/JavaScript SDK and source -->
         <fileSet>
             <directory>../sdks/html5-javascript</directory> 
-            
<outputDirectory>${artifact.artifactId}-${artifact.version}/sdks/html5-javascript</outputDirectory>
+            
<outputDirectory>${artifact.artifactId}-${releaseVersion}/sdks/html5-javascript</outputDirectory>
             <excludes>
                 <exclude>%ant[**/.idea/**]</exclude>
             </excludes>
@@ -83,7 +86,7 @@
         <!-- Java SDK and source -->
         <fileSet>
             <directory>../sdks/java</directory>
-            
<outputDirectory>${artifact.artifactId}-${artifact.version}/sdks/java</outputDirectory>
+            
<outputDirectory>${artifact.artifactId}-${releaseVersion}/sdks/java</outputDirectory>
             <excludes>
                 <exclude>%ant[**/.idea/**]</exclude>
                 <exclude>%ant[**/target/classes/**]</exclude>

Reply via email to