You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by dl...@apache.org on 2016/12/16 01:42:23 UTC
incubator-edgent git commit: Add a full collection of buildTools
Repository: incubator-edgent
Updated Branches:
refs/heads/master 365bf3aa1 -> a3ab4a2c4
Add a full collection of buildTools
Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/a3ab4a2c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/a3ab4a2c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/a3ab4a2c
Branch: refs/heads/master
Commit: a3ab4a2c46def45f48d523fcc498bf603213f3bc
Parents: 365bf3a
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Thu Dec 15 20:22:52 2016 -0500
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Thu Dec 15 20:22:52 2016 -0500
----------------------------------------------------------------------
buildTools/check_sigs.sh | 32 +++---
buildTools/common.sh | 166 +++++++++++++++++++++++++++++
buildTools/download_edgent_asf.sh | 132 +++++++++++++++++++++++
buildTools/make_release_branch.sh | 66 ++++++------
buildTools/merge_release.sh | 67 ++++++++++++
buildTools/publish_release.sh | 80 ++++++++++++++
buildTools/refresh_release_branch.sh | 51 +++++++++
buildTools/stage_release_candidate.sh | 127 ++++++++++++++++++++++
buildTools/tag_release.sh | 86 +++++++++++++++
buildTools/tag_release_candidate.sh | 46 ++++++++
10 files changed, 804 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a3ab4a2c/buildTools/check_sigs.sh
----------------------------------------------------------------------
diff --git a/buildTools/check_sigs.sh b/buildTools/check_sigs.sh
index 764cd6d..671c746 100755
--- a/buildTools/check_sigs.sh
+++ b/buildTools/check_sigs.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/sh
################################################################################
##
@@ -19,32 +19,29 @@
##
################################################################################
+set -e
+
# Checks the signatures of all bundles in the build/release-edgent directory
# Or checks the bundles in the specified directory
-if [ $1 == "-?" -o $1 == "help" -o $# -gt 1 ]
-then
- echo "Usage: check_sigs.sh [bundle-directory]"
- exit 1
-fi
+. `dirname $0`/common.sh
-# Assumes run from the root of the edgent git repo
-EDGENT_ROOT=.
+setUsage "`basename $0` [bundle-directory]"
+handleHelp "$@"
-BUNDLE_DIR="${EDGENT_ROOT}/build/release-edgent"
if [ $# -ge 1 ]
then
- BUNDLE_DIR=$1
+ BUNDLE_DIR=$1; shift
fi
-if [ ! -d ${BUNDLE_DIR} ]
-then
- echo "Bundle directory '${BUNDLE_DIR}' does not exist"
- exit 1
-fi
+noExtraArgs "$@"
+
+[ -d ${BUNDLE_DIR} ] || die "Bundle directory \"${BUNDLE_DIR}\" does not exist"
function checkFile() {
FILE="$1"
+ echo
+ echo "Checking $FILE..."
HASH=`md5 -q "${FILE}"`
CHECK=`cat "${FILE}.md5"`
@@ -72,9 +69,10 @@ function checkFile() {
}
-for bundle in "${BUNDLE_DIR}/*.tgz"
+for bundle in ${BUNDLE_DIR}/*.tgz
do
- checkFile $bundle
+ checkFile ${bundle}
done
+echo
echo "SUCCESS: all checksum and signature files OK"
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a3ab4a2c/buildTools/common.sh
----------------------------------------------------------------------
diff --git a/buildTools/common.sh b/buildTools/common.sh
new file mode 100755
index 0000000..d351b33
--- /dev/null
+++ b/buildTools/common.sh
@@ -0,0 +1,166 @@
+#!/bin/sh
+
+################################################################################
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+################################################################################
+
+BUILDTOOLS_DIR=`dirname $0`
+
+EDGENT_ROOT_DIR=.
+BUNDLE_DIR=${EDGENT_ROOT_DIR}/build/release-edgent
+
+EDGENT_ASF_GIT_URL=https://git-wip-us.apache.org/repos/asf/incubator-edgent.git
+EDGENT_ASF_SVN_RELEASE_URL=https://dist.apache.org/repos/dist/release/incubator/edgent
+EDGENT_ASF_SVN_RC_URL=https://dist.apache.org/repos/dist/dev/incubator/edgent
+
+USAGE=
+
+function die() { # [$* msgs]
+ [ $# -gt 0 ] && echo "Error: $*"
+ exit 1
+}
+
+function setUsage() { # $1: usage string
+ USAGE=$1
+}
+
+function usage() { # [$*: msgs]
+ [ $# -gt 0 ] && echo "Error: $*"
+ echo "Usage: ${USAGE}"
+ exit 1
+}
+
+function handleHelp() { # usage: handleHelp "$@"
+ if [ "$1" == "-?" -o "$1" == "--help" ]; then
+ usage
+ fi
+}
+
+function requireArg() { # usage: requireArgs "$@"
+ if [ $# -lt 1 ] || [[ $1 =~ ^- ]]; then
+ usage "missing argument"
+ fi
+}
+
+function noExtraArgs() { # usage: noExtraArgs "$@"
+ [ $# = 0 ] || usage "extra arguments"
+}
+
+function confirm () { # [$1: question]
+ while true; do
+ # call with a prompt string or use a default
+ /bin/echo -n "${1:-Are you sure?}"
+ read -r -p " [y/n] " response
+ case $response in
+ [yY]) return `true` ;;
+ [nN]) return `false` ;;
+ *) echo "illegal response '$response'" ;;
+ esac
+ done
+}
+
+function checkEdgentSourceRootGitDie { # no args; dies if !ok
+ [ -d "${EDGENT_ROOT_DIR}/.git" ] || die "Not an Edgent source root git directory \"${EDGENT_ROOT_DIR}\""
+}
+
+function checkUsingMgmtCloneWarn() { # no args; warns if edgent root isn't a mgmt clone
+ CLONE_DIR=`cd ${EDGENT_ROOT_DIR}; pwd`
+ CLONE_DIRNAME=`basename $CLONE_DIR`
+ if [ ! `echo $CLONE_DIRNAME | grep -o -E '^mgmt-edgent'` ]; then
+ echo "Warning: the Edgent root dir \"${EDGENT_ROOT_DIR}\" is not a release mgmt clone!"
+ return 1
+ else
+ return 0
+ fi
+}
+
+function getEdgentVer() { # $1 == "gradle" | "bundle"
+ MSG="getEdgentVer(): unknown mode \"$1\""
+ VER=""
+ if [ $1 == "gradle" ]; then
+ # Get the X.Y.Z version from gradle build info
+ PROPS=${EDGENT_ROOT_DIR}/gradle.properties
+ VER=`grep build_version ${PROPS} | grep -o -E '\d+\.\d+\.\d+'`
+ MSG="Unable to identify the version id from ${PROPS}"
+ elif [ $1 == "bundle" ]; then
+ # Get the X.Y.Z version from a build generated bundle's name
+ BUNDLE=`echo ${BUNDLE_DIR}/*-src.tgz`
+ VER=`echo ${BUNDLE} | grep -o -E '\d+\.\d+\.\d+'`
+ MSG="Unable to identify the version id from bundle ${BUNDLE}"
+ fi
+ [ "${VER}" ] || die "${MSG}"
+ echo $VER
+}
+
+function checkBundleDir() { # no args returns true/false (0/1)
+ if [ -d ${BUNDLE_DIR} ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+function checkVerNum() { # $1: X.Y.Z returns true/false (0/1)
+ if [ `echo $1 | grep -o -E '^\d+\.\d+\.\d+$'` ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+function checkVerNumDie() { # $1: X.Y.Z dies if not ok
+ checkVerNum $1 || die "Not a X.Y.Z version number \"$1\""
+}
+
+function checkRcNum() { # $1: rc-num returns true/false (0/1)
+ if [ `echo $1 | grep -o -E '^\d+$'` ] && [ $1 != 0 ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+function checkRcNumDie() { # $1: rc-num dies if not ok
+ checkRcNum $1 || die "Not a release candidate number \"$1\""
+}
+
+function getReleaseBranch() { # $1: X.Y.Z version
+ checkVerNumDie $1
+ echo "release-$1"
+}
+
+function getReleaseTag() { # $1: X.Y.Z [$2: rc-num]
+ VER=$1; shift
+ checkVerNumDie ${VER}
+ RC_SFX=""
+ if [ $# -gt 0 ] && [ "$1" != "" ]; then
+ RC_SFX="-RC$1"
+ fi
+ echo "${VER}-incubating${RC_SFX}"
+}
+
+function getReleaseTagComment() { # $1: X.Y.Z [$2: rc-num]
+ VER=$1; shift
+ checkVerNumDie ${VER}
+ RC_SFX=""
+ if [ $# -gt 0 ] && [ "$1" != "" ]; then
+ checkRcNumDie $1
+ RC_SFX=" RC$1"
+ fi
+ echo "Apache Edgent ${VER}-incubating${RC_SFX}"
+}
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a3ab4a2c/buildTools/download_edgent_asf.sh
----------------------------------------------------------------------
diff --git a/buildTools/download_edgent_asf.sh b/buildTools/download_edgent_asf.sh
new file mode 100755
index 0000000..b464513
--- /dev/null
+++ b/buildTools/download_edgent_asf.sh
@@ -0,0 +1,132 @@
+#!/bin/sh
+
+################################################################################
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+################################################################################
+
+set -e
+
+# Download the collection of files associated with an Apache Edgent
+# Release or Release Candidate from the Apache Distribution area:
+# https://dist.apache.org/repos/dist/release/incubator/edgent
+# or https://dist.apache.org/repos/dist/dev/incubator/edgent
+# respectively.
+#
+# Prompts before taking actions unless "--nquery"
+# Prompts to perform signature validation (using buildTools/check_sigs.sh)
+# unless --nvalidate or --validate is specified.
+
+. `dirname $0`/common.sh
+
+setUsage "`basename $0` [--nquery] [--validate|--nvalidate] <version> [<rc-num>]"
+handleHelp "$@"
+
+NQUERY=
+if [ "$1" == "--nquery" ]; then
+ NQUERY="--nquery"; shift
+fi
+
+VALIDATE=-1 # query
+if [ "$1" == "--validate" ]; then
+ VALIDATE=1; shift
+elif [ "$1" == "--nvalidate" ]; then
+ VALIDATE=0; shift
+fi
+
+requireArg "$@"
+VER=$1; shift
+checkVerNum $VER || usage "Not a X.Y.Z version number \"$VER\""
+
+RC_NUM=
+if [ $# -gt 0 ]; then
+ RC_NUM=$1; shift
+ checkRcNum ${RC_NUM} || usage "Not a release candidate number \"${RC_NUM}\""
+fi
+
+noExtraArgs "$@"
+
+# Release or Release Candidate mode
+IS_RC=
+if [ ${RC_NUM} ]; then
+ IS_RC=1
+fi
+
+BASE_URL=${EDGENT_ASF_SVN_RELEASE_URL}
+if [ ${IS_RC} ]; then
+ BASE_URL=${EDGENT_ASF_SVN_RC_URL}
+fi
+
+RC_SFX=
+if [ ${IS_RC} ]; then
+ RC_SFX=rc${RC_NUM}
+fi
+
+DST_BASE_DIR=downloaded-edgent-${VER}${RC_SFX}
+DST_VER_DIR=${DST_BASE_DIR}/${VER}-incubating
+if [ ${IS_RC} ]; then
+ DST_VER_DIR=${DST_VER_DIR}/${RC_SFX}
+fi
+[ -d ${DST_BASE_DIR} ] && die "${DST_BASE_DIR} already exists"
+
+[ ${NQUERY} ] || confirm "Proceed to download to ${DST_BASE_DIR} from ${BASE_URL}?" || exit
+
+echo Downloading to ${DST_BASE_DIR} ...
+
+# make a template structure of everything we're going to retrieve
+mkdir -p ${DST_BASE_DIR}
+(cd ${DST_BASE_DIR}; touch KEYS)
+
+mkdir -p ${DST_VER_DIR}
+(cd ${DST_VER_DIR}; touch LICENSE README RELEASE_NOTES apache-edgent-${VER}-incubating-src.tgz{,.asc,.md5,.sha} )
+
+mkdir -p ${DST_VER_DIR}/binaries
+(cd ${DST_VER_DIR}/binaries; touch LICENSE apache-edgent-${VER}-incubating-bin.tgz{,.asc,.md5,.sha} )
+
+# download everything identified in the template tree
+ORIG_DIR=`pwd`
+cd `pwd`/${DST_BASE_DIR}
+for i in `find . -type f`; do
+ echo ======= $i
+ uri=`echo $i | sed -e s?^./??` # strip leading "./"
+ url=${BASE_URL}/$uri
+ d=`dirname $i`
+ # OSX lacks wget by default
+ echo "(cd $d; curl -f -O $url)"
+ (cd $d; curl -f -O $url)
+done
+cd ${ORIG_DIR}
+
+echo
+echo Done Downloading to ${DST_BASE_DIR}
+
+[ ${VALIDATE} == 0 ] && exit
+[ ${VALIDATE} == 1 ] || [ ${NQUERY} ] || confirm "Do you want to check the bundle signatures?" || exit
+
+echo
+echo "If the following bundle gpg signature checks fail, you may need to"
+echo "import the project's list of signing keys to your keyring"
+echo " $ gpg ${DST_BASE_DIR}/KEYS # show the included keys"
+echo " $ gpg --import ${DST_BASE_DIR}/KEYS"
+
+echo
+echo "Verifying the source bundle signatures..."
+$BUILDTOOLS_DIR/check_sigs.sh ${DST_VER_DIR}
+
+echo
+echo "Verifying the binary bundle signatures..."
+$BUILDTOOLS_DIR/check_sigs.sh ${DST_VER_DIR}/binaries
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a3ab4a2c/buildTools/make_release_branch.sh
----------------------------------------------------------------------
diff --git a/buildTools/make_release_branch.sh b/buildTools/make_release_branch.sh
index 8b4d377..02d449c 100755
--- a/buildTools/make_release_branch.sh
+++ b/buildTools/make_release_branch.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/sh
################################################################################
##
@@ -19,44 +19,46 @@
##
################################################################################
+set -e
-# This script creates a release branch for the Apache Edgent version from gradle.properties/build_version
+# Creates a branch for the release.
+# Uses the version id from gradle.properties.
+# Prompts before taking actions unless "--nquery".
#
-# Must be run at the root of a clone of the master ASF git repository from https://git-wip-us.apache.org/repos/asf/incubator-edgent.git
+# Run from the root of the release management git clone.
+#
+# Prior to running this, create a new release management clone
+# from the ASF git repository. The name of the clone's directory should
+# start with "mgmt-edgent" as the builtTools scripts check for that
+# to help keep one on the right path, e.g.,
+#
+# git clone https://git-wip-us.apache.org/repos/asf/incubator-edgent.git mgmt-edgent<version>
-if [ $# -ne 0 ]
-then
- echo Usage: buildTools/make_release_branch.sh
-fi
+. `dirname $0`/common.sh
-EDGENT_VERSION=`grep build_version gradle.properties | awk '{print $2}'`
-CHECK=`echo "$EDGENT_VERSION" | grep -q -E '[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}$'`
+setUsage "`basename $0` [--nquery]"
+handleHelp "$@"
-if [ $? -ne 0 ]
-then
- echo "Apache Edgent version needs to be in the form [0-100].[0-100].[0-999]"
- exit 1;
+NQUERY=
+if [ "$1" == "--nquery" ]; then
+ NQUERY="--nquery"; shift
fi
-EDGENT_ROOT=.
-RELEASE_BRANCH=release${EDGENT_VERSION}
-RELEASE_CLONE_DIRNAME=asfclone-edgent${EDGENT_VERSION}
+noExtraArgs "$@"
+
+checkEdgentSourceRootGitDie
+checkUsingMgmtCloneWarn || [ ${NQUERY} ] || confirm "Proceed using this clone?" || exit
+
+VER=`getEdgentVer gradle`
+RELEASE_BRANCH=`getReleaseBranch $VER`
-echo "Updating local master branch"
-git checkout master
-git fetch origin
-git rebase origin/master
+(set -x; git checkout -q master)
+(set -x; git status)
+[ ${NQUERY} ] || confirm "Proceed to create release branch ${RELEASE_BRANCH}?" || exit
echo "Creating release branch ${RELEASE_BRANCH}"
-git push -u origin master:${RELEASE_BRANCH}
-
-echo "Creating new clone ${RELEASE_CLONE_DIRNAME} for release work"
-cd ${EDGENT_ROOT}/..
-mkdir "${RELEASE_CLONE_DIRNAME}"
-cd "${RELEASE_CLONE_DIRNAME}"
-git clone https://git-wip-us.apache.org/repos/asf/incubator-edgent.git .
-
-echo "Creating the RC1 tag"
-git checkout ${RELEASE_BRANCH}
-git tag -a apache-edgent-${EDGENT_VERSION}RC1 -m "Apache Edgent ${EDGENT_VERSION} RC1"
-git push --tags
+# don't just use "git push -u origin master:${RELEASE_BRANCH}" as some suggested
+# to *create* the branch as that changes the local master to track the new
+# remote branch. yikes.
+(set -x; git checkout -b ${RELEASE_BRANCH})
+(set -x; git push -u origin ${RELEASE_BRANCH})
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a3ab4a2c/buildTools/merge_release.sh
----------------------------------------------------------------------
diff --git a/buildTools/merge_release.sh b/buildTools/merge_release.sh
new file mode 100755
index 0000000..c4b627f
--- /dev/null
+++ b/buildTools/merge_release.sh
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+################################################################################
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+################################################################################
+
+set -e
+
+# Merges the release branch to the master branch.
+# Uses the version id from gradle.properties to identify the branch.
+# Prompts before taking actions.
+#
+# Run from the root of the release management git clone.
+
+. `dirname $0`/common.sh
+
+setUsage "`basename $0`"
+handleHelp "$@"
+
+noExtraArgs "$@"
+
+checkEdgentSourceRootGitDie
+checkUsingMgmtCloneWarn || confirm "Proceed using this clone?" || exit
+
+VER=`getEdgentVer gradle`
+RELEASE_BRANCH=`getReleaseBranch $VER`
+
+(set -x; git checkout -q master)
+(set -x; git status)
+
+confirm "Proceed to refresh the local master branch prior to merging?" || exit
+(set -x; git pull origin master)
+
+echo
+echo "If you proceed to merge and there are conflicts you will need to"
+echo "fix the conflicts and then commit the merge and push:"
+echo " git commit -m \"merged ${RELEASE_BRANCH}\""
+echo " git push origin master"
+echo "If you choose not to proceed you may run this script again later."
+
+confirm "Proceed to (no-commit) merge branch ${RELEASE_BRANCH} to master?" || exit
+(set -x; git merge --no-commit --no-ff ${RELEASE_BRANCH})
+
+echo
+echo "If you choose not to proceed you will need to manually complete the"
+echo "merge and push:"
+echo " git commit -m \"merged ${RELEASE_BRANCH}\""
+echo " git push origin master"
+
+confirm "Proceed to commit the merge and push?" || exit
+(set -x; git commit -m "merged ${RELEASE_BRANCH}")
+(set -x; git push origin master)
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a3ab4a2c/buildTools/publish_release.sh
----------------------------------------------------------------------
diff --git a/buildTools/publish_release.sh b/buildTools/publish_release.sh
new file mode 100755
index 0000000..572e268
--- /dev/null
+++ b/buildTools/publish_release.sh
@@ -0,0 +1,80 @@
+#!/bin/sh
+
+################################################################################
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+################################################################################
+
+set -e
+
+# Copy the (approved) release candidate artifacts and KEYS from the
+# ASF subversion Edgent Release Candidate repository to the
+# ASF subversion Edgent Release repository.
+# Prompts before taking actions.
+#
+# Run from the root of the release management git clone.
+
+. `dirname $0`/common.sh
+
+setUsage "`basename $0` <rc-num>"
+handleHelp "$@"
+
+requireArg "$@"
+RC_NUM=$1; shift
+checkRcNum ${RC_NUM} || usage "Not a release candidate number \"${RC_NUM}\""
+RC_DIRNAME="rc${RC_NUM}"
+
+noExtraArgs "$@"
+
+SVN_DEV_EDGENT=~/svn/dist.apache.org/repos/dist/dev/incubator/edgent
+SVN_REL_EDGENT=~/svn/dist.apache.org/repos/dist/release/incubator/edgent
+
+checkUsingMgmtCloneWarn || confirm "Proceed using this clone?" || exit
+
+# Get the X.Y.Z version from gradle
+VER=`getEdgentVer gradle`
+VER_DIRNAME=${VER}-incubating
+
+RC_TAG=`getReleaseTag ${VER} ${RC_NUM}`
+RELEASE_TAG=`getReleaseTag ${VER}`
+
+COMMIT_MSG="Release Apache Edgent ${RELEASE_TAG} from ${RC_TAG}"
+
+confirm "Proceed to publish release ${RELEASE_TAG} from candidate ${RC_TAG}?" || exit
+
+echo
+confirm "Proceed to update the KEYS?" || exit
+(set -x; svn update ${SVN_DEV_EDGENT}/KEYS)
+SVN_PARENT_DIR=`dirname ${SVN_REL_EDGENT}`
+(set -x; mkdir -p ${SVN_PARENT_DIR})
+(set -x; cd ${SVN_PARENT_DIR}; svn co ${EDGENT_ASF_SVN_RELEASE_URL} --depth empty)
+(set -x; svn update ${SVN_REL_EDGENT}/KEYS)
+(set -x; cp ${SVN_DEV_EDGENT}/KEYS ${SVN_REL_EDGENT}/KEYS)
+# it's OK if nothing changed / nothing to commit...
+(set -x; svn commit ${SVN_REL_EDGENT}/KEYS -m "${COMMIT_MSG}")
+
+echo
+confirm "Proceed to move the ${RC_TAG} artifacts?" || exit
+(set -x; svn move \
+ ${EDGENT_ASF_SVN_DEV_URL}/${VER_DIRNAME}/${RC_DIRNAME} \
+ ${EDGENT_ASF_SVN_RELEASE_URL}/${VER_DIRNAME} \
+ -m "${COMMIT_MSG}")
+
+echo
+echo "The ASF dev and release repositories have been updated:"
+echo " ${EDGENT_ASF_SVN_DEV_URL}"
+echo " ${EDGENT_ASF_SVN_RELEASE_URL}"
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a3ab4a2c/buildTools/refresh_release_branch.sh
----------------------------------------------------------------------
diff --git a/buildTools/refresh_release_branch.sh b/buildTools/refresh_release_branch.sh
new file mode 100755
index 0000000..bf7ab87
--- /dev/null
+++ b/buildTools/refresh_release_branch.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+################################################################################
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+################################################################################
+
+set -e
+
+# Refresh the clone's release branch from the "origin" git remote.
+# Prompts before taking actions unless "--nquery"
+
+. `dirname $0`/common.sh
+
+setUsage "`basename $0` [--nquery]"
+handleHelp "$@"
+
+NQUERY=
+if [ "$1" == "--nquery" ]; then
+ NQUERY="--nquery"; shift
+fi
+
+noExtraArgs "$@"
+
+checkEdgentSourceRootGitDie
+checkUsingMgmtCloneWarn || [ ${NQUERY} ] || confirm "Proceed using this clone?" || exit
+
+VER=`getEdgentVer gradle`
+RELEASE_BRANCH=`getReleaseBranch ${VER}`
+
+(set -x; git checkout -q ${RELEASE_BRANCH})
+(set -x; git status)
+
+[ ${NQUERY} ] || confirm "Proceed to refresh branch ${RELEASE_BRANCH} from the origin?" || exit
+
+echo "Refreshing branch ${RELEASE_BRANCH}"
+(set -x; git pull origin ${RELEASE_BRANCH})
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a3ab4a2c/buildTools/stage_release_candidate.sh
----------------------------------------------------------------------
diff --git a/buildTools/stage_release_candidate.sh b/buildTools/stage_release_candidate.sh
new file mode 100755
index 0000000..51f68ef
--- /dev/null
+++ b/buildTools/stage_release_candidate.sh
@@ -0,0 +1,127 @@
+#!/bin/sh
+
+################################################################################
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+################################################################################
+
+set -e
+
+# Copy the build generated artifacts to a working copy of the
+# ASF subversion Edgent Release Candidate repository.
+# If the user hasn't already setup a svn checkout the script offers to do it
+# to ~/svn/dist.apache.org/repos/dist/dev/incubator/edgent.
+# The user is provided with the svn command to commit the changes to the repo.
+# Prompts before taking actions.
+#
+# Run from the root of the release management git clone.
+
+
+. `dirname $0`/common.sh
+
+setUsage "`basename $0` <rc-num>"
+handleHelp "$@"
+
+requireArg "$@"
+RC_NUM=$1; shift
+checkRcNum ${RC_NUM} || usage "Not a release candidate number \"${RC_NUM}\""
+RC_DIRNAME="rc${RC_NUM}"
+
+noExtraArgs "$@"
+
+SVN_DEV_EDGENT=~/svn/dist.apache.org/repos/dist/dev/incubator/edgent
+
+checkBundleDir || die "Bundle directory '${BUNDLE_DIR}' does not exist"
+
+checkUsingMgmtCloneWarn || confirm "Proceed using this clone?" || exit
+
+# Get the X.Y.Z version from the bundle name
+VER=`getEdgentVer bundle`
+VER_DIRNAME=${VER}-incubating
+
+RC_TAG=`getReleaseTag ${VER} ${RC_NUM}`
+
+echo "Base svn Edgent dev directory to stage to: ${SVN_DEV_EDGENT}"
+confirm "Proceed with staging for ${RC_TAG}?" || exit
+
+# Offer to do svn checkout if needed
+if [ ! -d ${SVN_DEV_EDGENT}/.svn ]; then
+ echo "${SVN_DEV_EDGENT}/.svn: No such file or directory"
+ confirm "Setup that svn checkout now?" || exit
+ echo "Be patient while downloading..."
+ SVN_PARENT_DIR=`dirname ${SVN_DEV_EDGENT}`
+ (set -x; mkdir -p ${SVN_PARENT_DIR})
+ (set -x; cd ${SVN_PARENT_DIR}; svn co ${EDGENT_ASF_SVN_RC_URL} --depth empty)
+ (set -x; svn update ${SVN_DEV_EDGENT}/KEYS)
+fi
+
+SVN_VER_DIR=${SVN_DEV_EDGENT}/${VER_DIRNAME}
+SVN_RC_DIR=${SVN_VER_DIR}/${RC_DIRNAME}
+
+echo ""
+echo "Checking the svn status of ${SVN_DEV_EDGENT}:"
+(cd ${SVN_DEV_EDGENT}; svn status)
+echo
+confirm "Is the svn status ok to continue (blank / nothing reported) ?" || exit
+
+# Create this structure in the Edgent dev svn tree
+#
+# KEYS
+# X.Y.Z-incubating
+# rc<n>
+# README
+# RELEASE_NOTES
+# LICENSE
+# source bundles and signatures
+# binaries
+# LICENSE
+# source bundles and signatures
+
+echo ""
+echo "Copying artifacts to ${SVN_DEV_EDGENT}..."
+
+mkdir -p ${SVN_DEV_EDGENT}
+cp KEYS ${SVN_DEV_EDGENT}
+# svn add KEYS # adding was a one-time event
+
+if [ ! -d ${SVN_VER_DIR} ]; then
+ mkdir -p ${SVN_VER_DIR}
+fi
+
+mkdir -p ${SVN_RC_DIR}
+cp LICENSE ${SVN_RC_DIR}
+cp README ${SVN_RC_DIR}
+cp RELEASE_NOTES ${SVN_RC_DIR}
+cp ${BUNDLE_DIR}/*-src.* ${SVN_RC_DIR}
+
+mkdir -p ${SVN_RC_DIR}/binaries
+cp LICENSE ${SVN_RC_DIR}/binaries
+cp ${BUNDLE_DIR}/*-bin.* ${SVN_RC_DIR}/binaries
+
+(set -x; svn add ${SVN_RC_DIR})
+
+echo
+(set -x; svn status ${SVN_DEV_EDGENT})
+
+echo
+echo "If you choose not to proceed, you can later run the following to commit the changes:"
+echo " (cd ${SVN_DEV_EDGENT}; svn commit -m \"Add Apache Edgent ${VER}-incubating/rc${RC_NUM}\")"
+confirm "Proceed to commit the changes?" || exit
+(set -x; cd ${SVN_DEV_EDGENT}; svn commit -m \"Add Apache Edgent ${VER}-incubating/rc${RC_NUM}\")
+
+echo
+echo "The KEYS and ${RC_TAG} have been staged to ${EDGENT_ASF_SVN_RC_URL}"
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a3ab4a2c/buildTools/tag_release.sh
----------------------------------------------------------------------
diff --git a/buildTools/tag_release.sh b/buildTools/tag_release.sh
new file mode 100755
index 0000000..ba06bdc
--- /dev/null
+++ b/buildTools/tag_release.sh
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+################################################################################
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+################################################################################
+
+set -e
+
+# Create a tag on the release branch for the Edgent version from gradle.properties/build_version
+# A "release" tag is created unless directed to create a "release candidate"
+# tag via "--as-rcnum <rc-num>"
+# Specify "--from-rctag <rc-num>" to create the tag on the commit
+# that has the release candidate <rc-num> tag.
+# Prompts before taking actions unless "--nquery"
+#
+# Run from the root of the release management git clone.
+
+. `dirname $0`/common.sh
+
+setUsage "`basename $0` [--nquery] [--as-rcnum <rc-num>] [--from-rctag <rc-num>]"
+handleHelp "$@"
+
+NQUERY=
+if [ "$1" == "--nquery" ]; then
+ NQUERY="--nquery"; shift
+fi
+
+RC_NUM=
+if [ "$1" == "--as-rcnum" ]; then
+ shift; requireArg "$@"
+ RC_NUM=$1; shift
+ checkRcNum ${RC_NUM} || usage "Not a release candidate number \"${RC_NUM}\""
+fi
+
+FROM_RCTAG_NUM=
+if [ "$1" == "--from-rctag" ]; then
+ shift; requireArg "$@"
+ FROM_RCTAG_NUM=$1; shift
+ checkRcNum ${FROM_RCTAG_NUM} || usage "Not a release candidate number \"${FROM_RCTAG_NUM}\""
+fi
+
+noExtraArgs "$@"
+
+checkEdgentSourceRootGitDie
+checkUsingMgmtCloneWarn || [ ${NQUERY} ] || confirm "Proceed using this clone?" || exit
+
+VER=`getEdgentVer gradle`
+RELEASE_BRANCH=`getReleaseBranch ${VER}`
+
+TAG=`getReleaseTag ${VER} ${RC_NUM}`
+TAG_COMMENT=`getReleaseTagComment ${VER} ${RC_NUM}`
+
+TO_MSG="branch ${RELEASE_BRANCH}"
+
+FROM_RCTAG=
+if [ "${FROM_RCTAG_NUM}" ]; then
+ FROM_RCTAG=`getReleaseTag ${VER} ${FROM_RCTAG_NUM}`
+ TO_MSG="tag ${FROM_RCTAG}"
+fi
+
+[ ${NQUERY} ] || confirm "Proceed to add tag \"${TAG}\" to ${TO_MSG}?" || exit
+
+echo "Creating tag ${TAG} to ${TO_MSG}"
+(set -x; git checkout -q ${RELEASE_BRANCH})
+if [ "$FROM_RCTAG" ]; then
+ (set -x; git tag -a ${TAG} -m "${TAG_COMMENT}" ${FROM_RCTAG})
+else
+ (set -x; git tag -a ${TAG} -m "${TAG_COMMENT}")
+fi
+(set -x; git push origin ${TAG})
+(set -x; git show ${TAG} -s)
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a3ab4a2c/buildTools/tag_release_candidate.sh
----------------------------------------------------------------------
diff --git a/buildTools/tag_release_candidate.sh b/buildTools/tag_release_candidate.sh
new file mode 100755
index 0000000..62fe6ac
--- /dev/null
+++ b/buildTools/tag_release_candidate.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+################################################################################
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+################################################################################
+
+set -e
+
+# Create a tag on the release branch for the release candidate
+# Edgent version from gradle.properties/build_version
+# Prompts before taking actions unless "--nquery"
+#
+# Run from the root of the release management git clone.
+
+. `dirname $0`/common.sh
+
+setUsage "`basename $0` [--nquery] <rc-num>"
+handleHelp "$@"
+
+NQUERY=
+if [ "$1" == "--nquery" ]; then
+ NQUERY="--nquery"; shift
+fi
+
+requireArg "$@"
+RC_NUM=$1; shift
+checkRcNum ${RC_NUM} || usage "Not a release candidate number \"${RC_NUM}\""
+
+noExtraArgs "$@"
+
+`dirname $0`/tag_release.sh ${NQUERY} --as-rcnum ${RC_NUM}