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 2018/01/24 22:54:23 UTC
[5/5] incubator-edgent git commit: update scripts
update scripts
- new tag style "edgent-X.Y.Z"
- new release branch style "release/<major>.<minor>" (no bugfix#)
- add new begin_release.sh
- make stage_release_candidate.sh add the checksum files
- disable scripts superceeded by the maven plugin
Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/0adfee33
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/0adfee33
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/0adfee33
Branch: refs/heads/develop
Commit: 0adfee337217ae902dc088b5e9e7b5afee919f42
Parents: 1236d93
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Wed Jan 24 15:23:18 2018 -0500
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Wed Jan 24 15:23:18 2018 -0500
----------------------------------------------------------------------
.gitignore | 3 ++
buildTools/begin_release.sh | 62 +++++++++++++++++++++++++
buildTools/common.sh | 74 +++++++++++++++++++++---------
buildTools/make_release_branch.sh | 2 +
buildTools/merge_release.sh | 5 +-
buildTools/publish_release.sh | 4 +-
buildTools/refresh_release_branch.sh | 2 +-
buildTools/stage_release_candidate.sh | 15 ++----
buildTools/tag_release.sh | 2 +
buildTools/tag_release_candidate.sh | 2 +
10 files changed, 135 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/0adfee33/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 6a7d96b..ee57946 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,9 @@
pom.xml.releaseBackup
release.properties
+# Exclude buildTooling tmp artifacts
+edgent.release.properties
+
# More generated artifacts
target/
/reports
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/0adfee33/buildTools/begin_release.sh
----------------------------------------------------------------------
diff --git a/buildTools/begin_release.sh b/buildTools/begin_release.sh
new file mode 100755
index 0000000..8847b40
--- /dev/null
+++ b/buildTools/begin_release.sh
@@ -0,0 +1,62 @@
+#!/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
+
+# Creates a management clone in which to execute the release process.
+# Records the version number of the release under construction so that
+# other buildTools don't require an arg / or query
+#
+# Run from a directory where you want to create the management clone,
+# or if using --skipClone, run from the root of the release management git clone.
+# Creates edgent.release.properties
+
+
+. `dirname $0`/common.sh
+
+setUsage "`basename $0` [--createClone] X.Y.Z"
+handleHelp "$@"
+
+MK_CLONE=
+if [ "$1" == "--createClone" ]; then
+ MK_CLONE=1
+fi
+
+requireArg "$@"
+VER=$1; shift
+checkVerNumDie ${VER}
+
+noExtraArgs "$@"
+
+CLONE_NAME="mgmt-edgent-${VER}"
+if [ "${MK_CLONE}" != "" ]; then
+ confirm "Proceed to create management clone ${CLONE_NAME}?" || exit
+ (set -x; git clone ${EDGENT_ASF_GIT_URL} ${CLONE_NAME})
+ cd ${CLONE_NAME}
+else
+ checkUsingMgmtCloneWarn || confirm "Proceed using this clone?" || exit
+ if [ -f ${RELEASE_PROP_FILE} ]; then
+ confirm "The release property file (${RELEASE_PROP_FILE}) already exists, continue to overwrite it?" || exit
+ fi
+fi
+
+createReleaseProperties ${VER}
+echo "The release property file has been created for release version ${VER}"
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/0adfee33/buildTools/common.sh
----------------------------------------------------------------------
diff --git a/buildTools/common.sh b/buildTools/common.sh
index 484d8a3..2cf438f 100755
--- a/buildTools/common.sh
+++ b/buildTools/common.sh
@@ -22,7 +22,8 @@
BUILDTOOLS_DIR=`dirname $0`
EDGENT_ROOT_DIR=.
-BUNDLE_DIR=${EDGENT_ROOT_DIR}/build/release-edgent
+# BUNDLE_DIR is results of maven release:perform's creation of release candidate
+BUNDLE_DIR=${EDGENT_ROOT_DIR}/target/checkout/target
EDGENT_ASF_GIT_URL=https://git-wip-us.apache.org/repos/asf/incubator-edgent.git
EDGENT_ASF_DIST_URL=https://www.apache.org/dist/incubator/edgent
@@ -32,6 +33,8 @@ EDGENT_ASF_SVN_RC_URL=https://dist.apache.org/repos/dist/dev/incubator/edgent
USAGE=
+RELEASE_PROP_FILE=${EDGENT_ROOT_DIR}/edgent.release.properties
+
function die() { # [$* msgs]
[ $# -gt 0 ] && echo "Error: $*"
exit 1
@@ -80,6 +83,10 @@ function confirm () { # [$1: question]
done
}
+function dieSuperceeded { # no args
+ die "This tool is superceeded with the new maven build tooling. See src/site/asciidoc/releasing.adoc."
+}
+
function checkEdgentSourceRootGitDie { # no args; dies if !ok
[ -d "${EDGENT_ROOT_DIR}/.git" ] || die "Not an Edgent source root git directory \"${EDGENT_ROOT_DIR}\""
}
@@ -93,24 +100,6 @@ function checkUsingMgmtCloneWarn() { # no args; warns if edgent root isn't a mgm
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}/apache-edgent-*-source-release.tar.gz`
- 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)
@@ -145,9 +134,51 @@ function checkRcNumDie() { # $1: rc-num dies if not ok
checkRcNum $1 || die "Not a release candidate number \"$1\""
}
+function createReleaseProperties { # X.Y.Z
+ VER="$1"
+ checkVerNumDie ${VER}
+ echo "releaseNum=${VER}" > ${RELEASE_PROP_FILE}
+}
+
+function getReleaseProperty { # <property-name>
+ PN=$1
+ PNVAL=`grep ${PN} ${RELEASE_PROP_FILE}`
+ VAL=`echo ${PNVAL} | sed -e "s/^${PN}=//"`
+ echo ${VAL}
+}
+
+function getEdgentVer() { # [$1 == "bundle"]
+ MSG="getEdgentVer(): unknown mode \"$1\""
+ VER=""
+ if [ "$1" == "" ]; then
+ VER=`getReleaseProperty releaseNum`
+ MSG="Unable to identify the release version id from ${RELEASE_PROP_FILE}"
+ elif [ $1 == "gradle" ]; then
+ die "'getEdgentVer() gradle' is no longer supported"
+ # 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}/apache-edgent-*-source-release.tar.gz`
+ 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 getMajMinVerNum() { # $1: X.Y.Z returns X.Y
+ VER=$1; shift
+ checkVerNumDie ${VER}
+ MAJ_MIN_VER=`echo ${VER} | sed -e 's/\.[0-9][0-9]*$//'`
+ echo ${MAJ_MIN_VER}
+}
+
function getReleaseBranch() { # $1: X.Y.Z version
- checkVerNumDie $1
- echo "release-$1"
+ MAJ_MIN_NUM=`getMajMinVerNum $1`
+ echo "release/${MAJ_MIN_NUM}"
}
function getReleaseTag() { # $1: X.Y.Z [$2: rc-num]
@@ -165,7 +196,6 @@ function getReleaseTagComment() { # $1: X.Y.Z [$2: rc-num]
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/0adfee33/buildTools/make_release_branch.sh
----------------------------------------------------------------------
diff --git a/buildTools/make_release_branch.sh b/buildTools/make_release_branch.sh
index 02d449c..c45d619 100755
--- a/buildTools/make_release_branch.sh
+++ b/buildTools/make_release_branch.sh
@@ -36,6 +36,8 @@ set -e
. `dirname $0`/common.sh
+dieSuperceeded # NOTICE THIS
+
setUsage "`basename $0` [--nquery]"
handleHelp "$@"
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/0adfee33/buildTools/merge_release.sh
----------------------------------------------------------------------
diff --git a/buildTools/merge_release.sh b/buildTools/merge_release.sh
index bd1269c..f21c2ed 100755
--- a/buildTools/merge_release.sh
+++ b/buildTools/merge_release.sh
@@ -37,7 +37,7 @@ noExtraArgs "$@"
checkEdgentSourceRootGitDie
checkUsingMgmtCloneWarn || confirm "Proceed using this clone?" || exit
-VER=`getEdgentVer gradle`
+VER=`getEdgentVer`
RELEASE_BRANCH=`getReleaseBranch $VER`
(set -x; git checkout -q master)
@@ -67,3 +67,6 @@ 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)
+
+echo
+echo "REMINDER: see the Release Manager's Guide for merges to the develop branch!"
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/0adfee33/buildTools/publish_release.sh
----------------------------------------------------------------------
diff --git a/buildTools/publish_release.sh b/buildTools/publish_release.sh
index ec81803..15b99e2 100755
--- a/buildTools/publish_release.sh
+++ b/buildTools/publish_release.sh
@@ -24,6 +24,7 @@ set -e
# Move/Copy the (approved) release candidate artifacts and KEYS from the
# ASF subversion Edgent Release Candidate repository to the
# ASF subversion Edgent Release repository.
+# Publishing of Nexus staged artifacts is separate! See the Release Manager's Guide
# Prompts before taking actions.
#
# Run from the root of the release management git clone.
@@ -45,8 +46,7 @@ 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=`getEdgentVer`
VER_DIRNAME=${VER}-incubating
RC_TAG=`getReleaseTag ${VER} ${RC_NUM}`
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/0adfee33/buildTools/refresh_release_branch.sh
----------------------------------------------------------------------
diff --git a/buildTools/refresh_release_branch.sh b/buildTools/refresh_release_branch.sh
index bf7ab87..b9973a4 100755
--- a/buildTools/refresh_release_branch.sh
+++ b/buildTools/refresh_release_branch.sh
@@ -39,7 +39,7 @@ noExtraArgs "$@"
checkEdgentSourceRootGitDie
checkUsingMgmtCloneWarn || [ ${NQUERY} ] || confirm "Proceed using this clone?" || exit
-VER=`getEdgentVer gradle`
+VER=`getEdgentVer`
RELEASE_BRANCH=`getReleaseBranch ${VER}`
(set -x; git checkout -q ${RELEASE_BRANCH})
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/0adfee33/buildTools/stage_release_candidate.sh
----------------------------------------------------------------------
diff --git a/buildTools/stage_release_candidate.sh b/buildTools/stage_release_candidate.sh
index fa63782..da20d92 100755
--- a/buildTools/stage_release_candidate.sh
+++ b/buildTools/stage_release_candidate.sh
@@ -42,7 +42,7 @@ RC_NUM=$1; shift
checkRcNum ${RC_NUM} || usage "Not a release candidate number \"${RC_NUM}\""
RC_DIRNAME="rc${RC_NUM}"
-BUNDLE_DIR=target/checkout/target
+# default BUNDLE_DIR is in common.sh
if [ $# -gt 0 ]; then
BUNDLE_DIR=$1; shift
fi
@@ -64,15 +64,10 @@ 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
-# at least until checksum file generation is automated verify that
-# make_checksums.sh has been run
-echo "Checking that bundle signature files are present ..."
-for b in ${BUNDLE_DIR}/apache-edgent-*-source-release.*; do
- for sfx in .asc .md5 .sha512; do
- f=${b}${sfx}
- [ -f ${f} ] || die "Bundle signature ${f} does not exist"
- done
-done
+# with the switch to the maven release plugin, only the .asc file
+# is generated, not the checksum files.
+# generate/update them now.
+${BUILDTOOLS_DIR}/make_checksums.sh target
# Offer to do svn checkout if needed
if [ ! -d ${SVN_DEV_EDGENT}/.svn ]; then
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/0adfee33/buildTools/tag_release.sh
----------------------------------------------------------------------
diff --git a/buildTools/tag_release.sh b/buildTools/tag_release.sh
index ba06bdc..21a3d81 100755
--- a/buildTools/tag_release.sh
+++ b/buildTools/tag_release.sh
@@ -32,6 +32,8 @@ set -e
. `dirname $0`/common.sh
+dieSuperceeded # NOTICE THIS
+
setUsage "`basename $0` [--nquery] [--as-rcnum <rc-num>] [--from-rctag <rc-num>]"
handleHelp "$@"
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/0adfee33/buildTools/tag_release_candidate.sh
----------------------------------------------------------------------
diff --git a/buildTools/tag_release_candidate.sh b/buildTools/tag_release_candidate.sh
index 62fe6ac..0518ee2 100755
--- a/buildTools/tag_release_candidate.sh
+++ b/buildTools/tag_release_candidate.sh
@@ -29,6 +29,8 @@ set -e
. `dirname $0`/common.sh
+dieSuperceeded # NOTICE THIS
+
setUsage "`basename $0` [--nquery] <rc-num>"
handleHelp "$@"