ACCUMULO-3843 Add email template to build.sh * Adds an email template and options to build.sh to generate a release candidate email after prompting for some basic information.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/8782a014 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/8782a014 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/8782a014 Branch: refs/heads/1.6 Commit: 8782a014370a6e5a8703a234bc20176f949f7d47 Parents: 0b0e8eb Author: Christopher Tubbs <ctubb...@apache.org> Authored: Wed Jun 10 19:36:25 2015 -0400 Committer: Christopher Tubbs <ctubb...@apache.org> Committed: Wed Jun 10 20:49:00 2015 -0400 ---------------------------------------------------------------------- assemble/build.sh | 85 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/8782a014/assemble/build.sh ---------------------------------------------------------------------- diff --git a/assemble/build.sh b/assemble/build.sh index 425c825..f2c9474 100755 --- a/assemble/build.sh +++ b/assemble/build.sh @@ -61,6 +61,87 @@ setupRPM() { fi } +createEmail() { + read -p 'Enter the staging repository number: ' stagingrepo + read -p 'Enter the version to be released (eg. x.y.z): ' tag + read -p 'Enter the release candidate number (eg. 1, 2, etc.): ' rc + + commit=$(git show $tag -n1 --pretty=raw --no-color | head -1 | awk '{print $2}') + branch=$tag-rc$rc + echo + echo "IMPORTANT!! IMPORTANT!! IMPORTANT!! IMPORTANT!! IMPORTANT!! IMPORTANT!!" + echo + echo " Don't forget to push a branch named $branch with" + echo " its head at ${commit:0:7} so people can review!" + echo + echo " However, do *NOT* push the $tag tag until after the vote" + echo " passes and the tag is re-made with a gpg signature using" + echo " \`git tag -f -m 'Apache Accumulo $tag' -s $tag ${commit:0:7}\`" + echo + echo "IMPORTANT!! IMPORTANT!! IMPORTANT!! IMPORTANT!! IMPORTANT!! IMPORTANT!!" + echo + read -p 'Press Enter to generate the [VOTE] email...' rc + + # compute the date with a buffer of 30 minutes + votedate=$(date -d "+3 days 30 minutes" "+%s") + # round back to the previous half-hour + halfhour=$(($votedate - ($votedate % 1800))) + votedate=$(date -u -d"1970-01-01 $halfhour seconds UTC") + export TZ="America/New_York" + edtvotedate=$(date -d"1970-01-01 $halfhour seconds UTC") + export TZ="America/Los_Angeles" + pdtvotedate=$(date -d"1970-01-01 $halfhour seconds UTC") + + cat <<EOF +============================================================ +Subject: [VOTE] Accumulo $branch +============================================================ + +Accumulo Developers, + +Please consider the following candidate for Accumulo $tag. + +Git Commit: + $commit +Branch: + $branch + +If this vote passes, a gpg-signed tag will be created using: + git tag -f -m 'Apache Accumulo $tag' -s $tag $commit + +Staging repo: https://repository.apache.org/content/repositories/orgapacheaccumulo-$stagingrepo +Source (official release artifact): https://repository.apache.org/content/repositories/orgapacheaccumulo-$stagingrepo/org/apache/accumulo/accumulo/$tag/accumulo-$tag-src.tar.gz +Binary: https://repository.apache.org/content/repositories/orgapacheaccumulo-$stagingrepo/org/apache/accumulo/accumulo/$tag/accumulo-$tag-bin.tar.gz +(Append ".sha1", ".md5", or ".asc" to download the signature/hash for a given artifact.) + +All artifacts were built and staged with: + mvn release:prepare && mvn release:perform + +Signing keys are available at https://www.apache.org/dist/accumulo/KEYS +(Expected fingerprint: $(gpg --list-secret-keys --with-colons --with-fingerprint | awk -F: '$1 == "fpr" {print $10}')) + +Release notes (in progress) can be found at https://accumulo.apache.org/release_notes/$tag + +Please vote one of: +[ ] +1 - I have verified and accept... +[ ] +0 - I have reservations, but not strong enough to vote against... +[ ] -1 - Because..., I do not accept... +... these artifacts as the $tag release of Apache Accumulo. + +This vote will end on $votedate +($edtvotedate / $pdtvotedate) + +Thanks! + +P.S. Hint: downlaod the whole staging repo with + wget -erobots=off -r -l inf -np -nH \\ + https://repository.apache.org/content/repositories/orgapacheaccumulo-$stagingrepo/ + # note the trailing slash is needed + +============================================================ +EOF +} + if [[ $1 = '--create-release-candidate' ]]; then cacheGPG; setupRPM # create a release candidate from a branch @@ -75,7 +156,9 @@ elif [[ $1 = '--test' ]]; then # build a tag, but with tests run mvn clean compile javadoc:aggregate install \ -P apache-release,check-licenses,thrift,native,assemble,docs,rpm,deb +elif [[ $1 = '--create-email' ]]; then + createEmail else - fail "Missing one of: --create-release-candidate, --test, --seal-jars" + fail "Missing one of: --create-release-candidate, --test, --seal-jars, --create-email" fi