You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2015/09/04 15:30:36 UTC

[13/15] incubator-brooklyn git commit: more tweaks to release script--

more tweaks to release script--

    use release/tmp/ and shopt expand_aliases,
    and option to automatically upload to svn


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3c08a7e0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3c08a7e0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3c08a7e0

Branch: refs/heads/master
Commit: 3c08a7e07582e9e1e27dba5b8b31e08da9871158
Parents: 2022fa8
Author: Alex Heneveld <al...@cloudsoft.io>
Authored: Thu Sep 3 23:48:21 2015 +0100
Committer: Alex Heneveld <al...@cloudsoft.io>
Committed: Fri Sep 4 00:58:53 2015 +0100

----------------------------------------------------------------------
 .../committers/release-process/publish-temp.md  |  3 ++
 release/.gitignore                              |  1 +
 release/make-release-artifacts.sh               | 57 ++++++++++++++------
 3 files changed, 45 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3c08a7e0/docs/website/developers/committers/release-process/publish-temp.md
----------------------------------------------------------------------
diff --git a/docs/website/developers/committers/release-process/publish-temp.md b/docs/website/developers/committers/release-process/publish-temp.md
index aaa6765..9727c52 100644
--- a/docs/website/developers/committers/release-process/publish-temp.md
+++ b/docs/website/developers/committers/release-process/publish-temp.md
@@ -25,6 +25,9 @@ svn add apache-brooklyn-${VERSION_NAME}-rc${RC_NUMBER}
 svn commit --message "Add apache-brooklyn-${VERSION_NAME}-rc${RC_NUMBER} to dist/dev/incubator/brooklyn"
 {% endhighlight %}
 
+These steps can be performed as part of the `make-release-artifacts.sh` script used earlier
+if `${APACHE_DIST_SVN_DIR}` points to the appropriate subversion directory.
+
 
 Close the staging repository on Apache's Nexus server
 -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3c08a7e0/release/.gitignore
----------------------------------------------------------------------
diff --git a/release/.gitignore b/release/.gitignore
index 8000dd9..16d63d3 100644
--- a/release/.gitignore
+++ b/release/.gitignore
@@ -1 +1,2 @@
 .vagrant
+tmp

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3c08a7e0/release/make-release-artifacts.sh
----------------------------------------------------------------------
diff --git a/release/make-release-artifacts.sh b/release/make-release-artifacts.sh
index ad0bd06..a9184f3 100755
--- a/release/make-release-artifacts.sh
+++ b/release/make-release-artifacts.sh
@@ -48,6 +48,9 @@ release.
 
 Specifying the RC number is required. Specifying the version number is
 discouraged; if auto detection is not working, then this script is buggy.
+
+Additionally if APACHE_DIST_SVN_DIR is set, this will transfer artifacts to
+that directory and svn commit them.
 END
 # ruler                      --------------------------------------------------
 }
@@ -131,15 +134,22 @@ fi
 
 release_script_dir=$( cd $( dirname $0 ) && pwd )
 brooklyn_dir=$( pwd )
-staging_dir="${release_script_dir}/tmp/working-src/${release_name}-src"
-bin_staging_dir="${release_script_dir}/tmp/working-bin/${release_name}-bin"
-artifact_dir="${release_script_dir}/${artifact_name}"
+rm -rf ${release_script_dir}/tmp
+staging_dir="${release_script_dir}/tmp/source/"
+src_staging_dir="${release_script_dir}/tmp/source/${release_name}-src"
+bin_staging_dir="${release_script_dir}/tmp/bin/"
+artifact_dir="${release_script_dir}/tmp/${artifact_name}"
 
 echo "The version is ${current_version}"
 echo "The rc suffix is rc${rc_suffix}"
 echo "The release name is ${release_name}"
 echo "The artifact name is ${artifact_name}"
 echo "The artifact directory is ${artifact_dir}"
+if [ ! -z "${APACHE_DIST_SVN_DIR}" ] ; then
+  echo "The artifacts will be copied and uploaded via ${APACHE_DIST_SVN_DIR}"
+else
+  echo "The artifacts will not be copied and uploaded to the svn repo"
+fi
 echo ""
 confirm "Is this information correct? [y/N]" || exit
 echo ""
@@ -161,15 +171,17 @@ git clean -dxf
 # Source release
 echo "Creating source release folder ${release_name}"
 set -x
-mkdir -p ${staging_dir}
-rsync -rtp --exclude src-release-tmp --exclude bin-release-tmp --exclude .git\* --exclude '**/*.[ejw]ar' --exclude docs/ sandbox/ release/ . ${staging_dir}
+mkdir -p ${src_staging_dir}
+mkdir -p ${bin_staging_dir}
+rsync -rtp --exclude .git\* --exclude docs/ --exclude sandbox/ --exclude release/ . ${staging_dir}/${release_name}-src
 
+rm -rf ${artifact_dir}
 mkdir -p ${artifact_dir}
 set +x
-echo "Creating artifact ${artifact_dir}/${artifact_name}.tar.gz and .zip"
+echo "Creating artifact ${artifact_dir}/${artifact_name}-src.tar.gz and .zip"
 set -x
-( cd src-release-tmp && tar czf ${artifact_dir}/${artifact_name}-src.tar.gz apache-brooklyn-${current_version}-src )
-( cd src-release-tmp && zip -qr ${artifact_dir}/${artifact_name}-src.zip apache-brooklyn-${current_version}-src )
+( cd ${staging_dir} && tar czf ${artifact_dir}/${artifact_name}-src.tar.gz ${release_name}-src )
+( cd ${staging_dir} && zip -qr ${artifact_dir}/${artifact_name}-src.zip ${release_name}-src )
 
 ###############################################################################
 # Binary release
@@ -187,25 +199,26 @@ else
 fi
 
 # Workaround for bug BROOKLYN-1
-( cd ${staging_dir} && mvn clean --projects :brooklyn-archetype-quickstart )
+( cd ${src_staging_dir} && mvn clean --projects :brooklyn-archetype-quickstart )
 
 # Perform the build and deploy to Nexus staging repository
-( cd ${staging_dir} && mvn deploy -Papache-release )
+( cd ${src_staging_dir} && mvn deploy -Papache-release )
+## To test the script without a big deploy, use the line below instead of above
+#( cd ${src_staging_dir} && cd usage/dist && mvn clean install )
 
 # Re-pack the archive with the correct names
-mkdir -p bin-release-tmp
-tar xzf ${staging_dir}/usage/dist/target/brooklyn-dist-${current_version}-dist.tar.gz -C bin-release-tmp
-mv bin-release-tmp/brooklyn-dist-${current_version} bin-release-tmp/apache-brooklyn-${current_version}-bin
+tar xzf ${src_staging_dir}/usage/dist/target/brooklyn-dist-${current_version}-dist.tar.gz -C ${bin_staging_dir}
+mv ${bin_staging_dir}/brooklyn-dist-${current_version} ${bin_staging_dir}/${release_name}-bin
 
-( cd bin-release-tmp && tar czf ${artifact_dir}/${artifact_name}-bin.tar.gz apache-brooklyn-${current_version}-bin )
-( cd bin-release-tmp && zip -qr ${artifact_dir}/${artifact_name}-bin.zip apache-brooklyn-${current_version}-bin )
+( cd ${bin_staging_dir} && tar czf ${artifact_dir}/${artifact_name}-bin.tar.gz ${release_name}-bin )
+( cd ${bin_staging_dir} && zip -qr ${artifact_dir}/${artifact_name}-bin.zip ${release_name}-bin )
 
 ###############################################################################
 # Signatures and checksums
 
 # OSX doesn't have sha256sum, even if MacPorts md5sha1sum package is installed.
 # Easy to fake it though.
-which sha256sum >/dev/null || alias sha256sum='shasum -a 256'
+which sha256sum >/dev/null || alias sha256sum='shasum -a 256' && shopt -s expand_aliases
 
 ( cd ${artifact_dir} &&
     for a in *.tar.gz *.zip; do
@@ -217,6 +230,18 @@ which sha256sum >/dev/null || alias sha256sum='shasum -a 256'
 )
 
 ###############################################################################
+
+if [ ! -z "${APACHE_DIST_SVN_DIR}" ] ; then
+  pushd ${APACHE_DIST_SVN_DIR}
+  rm -rf ${artifact_name}
+  cp -r ${artifact_dir} ${artifact_name}
+  svn add ${artifact_name}
+  svn commit --message "Add ${artifact_name} artifacts for incubator/brooklyn"
+  artifact_dir=${APACHE_DIST_SVN_DIR}/${artifact_name}
+  popd
+fi
+
+###############################################################################
 # Conclusion
 
 set +x