accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [06/12] accumulo git commit: Merge branch '1.7'
Date Fri, 22 Jan 2016 17:58:12 GMT
Merge branch '1.7'

Conflicts:
	assemble/build.sh


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

Branch: refs/heads/master
Commit: 4922ed7d8ff9545b8ffb3f5436b41356e032722c
Parents: 285893c e5401db
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Fri Jan 22 12:29:27 2016 -0500
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Fri Jan 22 12:29:27 2016 -0500

----------------------------------------------------------------------
 assemble/build.sh | 271 +++++++++++++++++++++++++++++++++++++------------
 pom.xml           |   4 +-
 2 files changed, 211 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4922ed7d/assemble/build.sh
----------------------------------------------------------------------
diff --cc assemble/build.sh
index cd6be5e,76bbb48..f7d9c8c
--- a/assemble/build.sh
+++ b/assemble/build.sh
@@@ -125,18 -149,143 +149,139 @@@ $(yellow '=============================
  EOF
  }
  
- if [[ $1 = '--create-release-candidate' ]]; then
-   cacheGPG
+ cleanUpAndFail() {
+   # $1 command; $2 log; $3 original branch; $4 next branch
+   echo "  Failure in $(red "$1")!"
+   echo "  Check output in $(yellow "$2")"
+   echo "  Initiating clean up steps..."
+ 
+   run git checkout "$3"
+ 
+   # pre-populate branches with expected next branch; de-duplicate later
+   local branches; branches=("$4")
+   local tags; tags=()
+   local x; local y
+   for x in $(gitCommits "${cBranch}..${nBranch}"); do
+     for y in $(git branch --contains "$x" | cut -c3-); do
+       branches=("${branches[@]}" "$y")
+     done
+     for y in $(git tag --contains "$x"); do
+       tags=("${tags[@]}" "$y")
+     done
+   done
+ 
+   # de-duplicate branches
+   local a
+   branches=($(printf "%s\n" "${branches[@]}" | sort -u))
+   for x in "${branches[@]}"; do
+     echo "Do you wish to clean up (delete) the branch $(yellow "$x")?"
+     a=$(prompter "letter 'y' or 'n'" '[yn]')
+     [[ $a == 'y' ]] && git branch -D "$x"
+   done
+   for x in "${tags[@]}"; do
+     echo "Do you wish to clean up (delete) the tag $(yellow "$x")?"
+     a=$(prompter "letter 'y' or 'n'" '[yn]')
+     [[ $a == 'y' ]] && git tag -d "$x"
+   done
+   exit 1
+ }
+ 
+ createReleaseCandidate() {
+   yellow  "WARNING!! WARNING!! WARNING!! WARNING!! WARNING!! WARNING!!"
+   echo
+   echo    "  This will modify your local git repository by creating"
+   echo    "  branches and tags. Afterwards, you may need to perform"
+   echo    "  some manual steps to complete the release or to rollback"
+   echo    "  in the case of failure."
+   echo
+   yellow  "WARNING!! WARNING!! WARNING!! WARNING!! WARNING!! WARNING!!"
+   echo
+ 
+   local extraReleaseArgs; extraReleaseArgs=("$@")
+   if [[ ${#extraReleaseArgs[@]} -ne 0 ]]; then
+     red "CAUTION!! Extra release args may create a non-standard release!!"
+     red "You added '${extraReleaseArgs[*]}'"
+   fi
+   [[ ${#extraReleaseArgs[@]} -eq 0 ]] && [[ $gpgCommand != 'gpg' ]] && extraReleaseArgs=("-Dgpg.executable=$gpgCommand")
+   extraReleaseArgs="-DextraReleaseArgs='${extraReleaseArgs[*]}'"
+ 
+   local ver
+   ver=$(xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' pom.xml)
+   ver=${ver%%-SNAPSHOT}
+   echo "Building release candidate for version: $(green "$ver")"
+ 
+   local cBranch; cBranch=$(currentBranch) || fail "$(red Failure)" to get current branch
from git
+   local rc; rc=$(prompter 'release candidate sequence number (eg. 1, 2, etc.)' '[0-9]+')
+   local rcBranch; rcBranch=$ver-rc$rc
+   local nBranch; nBranch=$rcBranch-next
+ 
+   cacheGPG || fail "Unable to cache GPG credentials into gpg-agent"
+ 
+   # create working branch
+   {
+     run git branch "$nBranch" "$cBranch" && run git checkout "$nBranch"
+   } || fail "Unable to create working branch $(red "$nBranch") from $(red "$cBranch")!"
+ 
    # create a release candidate from a branch
-   run mvn clean release:clean release:prepare release:perform
- elif [[ $1 = '--test' ]]; then
+   local oFile; oFile=$(mktemp --tmpdir "accumulo-build-$rcBranch-XXXXXXXX.log")
+   {
+     [[ -w $oFile ]] && runLog "$oFile" mvn clean release:clean
+   } || cleanUpAndFail 'mvn clean release:clean' "$oFile" "$cBranch" "$nBranch"
+   runLog "$oFile" mvn -B release:prepare "${extraReleaseArgs}" || \
+     cleanUpAndFail "mvn release:prepare ${extraReleaseArgs}" "$oFile" "$cBranch" "$nBranch"
+   runLog "$oFile" mvn release:perform "${extraReleaseArgs}" || \
+     cleanUpAndFail "mvn release:perform ${extraReleaseArgs}" "$oFile" "$cBranch" "$nBranch"
+ 
+   # switch back to original branch
+   run git checkout "${cBranch}"
+ 
+   # verify the next branch contains both expected log messages and no more
+   {
+     [[ $(gitCommits "${cBranch}..${nBranch}" | wc -l) -eq 2 ]] && \
+       [[ $(gitCommit  "${nBranch}~2") ==  $(gitCommit "${cBranch}") ]] && \
+       [[ $(gitSubject "${nBranch}")   =~ ^\[maven-release-plugin\]\ prepare\ for\ next ]]
&& \
+       [[ $(gitSubject "${nBranch}~1") =~ ^\[maven-release-plugin\]\ prepare\ release\ rel[/]$ver
]]
+   } || cleanUpAndFail "verifying that $nBranch contains only logs from release plugin"
+ 
+   # verify the tag is one behind $nBranch and one ahead of $cBranch
+   [[ $(gitCommit "${nBranch}~1") == $(gitCommit "refs/tags/rel/$ver") ]] || \
+     cleanUpAndFail "verifying that ${nBranch}~1 == refs/tags/rel/$ver"
+ 
+   # remove tag which was created
+   run git tag -d "rel/$ver" || \
+     cleanUpAndFail "removing unused git tag rel/$ver"
+ 
+   # create release candidate branch to vote on
+   run git branch "$rcBranch" "${nBranch}~1" || \
+     cleanUpAndFail "creating branch $rcBranch"
+ 
+   # push branches (ask first)
+   local origin; origin=$(git remote -v | grep ^origin | grep push | awk '{print $2}')
+   echo "Do you wish to push the following branches to origin ($(green "$origin"))?"
+   echo "  $(yellow "$rcBranch")      (for others to examine for the vote)"
+   echo "  $(yellow "$nBranch") (for merging into $cBranch if vote passes)"
+   local a; a=$(prompter "letter 'y' or 'n'" '[yn]')
+   {
+     [[ $a == 'y' ]] && \
+       run git push -u origin "refs/heads/$nBranch" "refs/heads/$rcBranch"
+   } || red "Did not push branches; you'll need to perform this step manually."
+ 
+   # continue to creating email notification
+   echo "$(red Running)" "$(yellow "$scriptname" --create-email "$ver" "$rc")"
+   createEmail "$ver" "$rc"
+ }
+ 
+ if [[ $1 == '--create-release-candidate' ]]; then
+   shift
+   createReleaseCandidate "$@"
 -elif [[ $1 == '--seal-jars' ]]; then
 -  cacheGPG
 -  # build a tag, but with sealed jars
 -  runOrFail mvn clean install -P apache-release,seal-jars,thrift,assemble,docs
+ elif [[ $1 == '--test' ]]; then
    cacheGPG
    # build a tag, but with tests
-   run mvn clean install \
-    -P apache-release,thrift,assemble,docs,accumulo-release
- elif [[ $1 = '--create-email' ]]; then
-   createEmail
 -  runOrFail mvn clean install -P apache-release,thrift,assemble,docs
++  runOrFail mvn clean install -P apache-release,thrift,assemble,docs,accumulo-release
+ elif [[ $1 == '--create-email' ]]; then
+   shift
+   createEmail "$@"
  else
-   fail "Missing one of: --create-release-candidate, --test, --create-email"
 -  fail "Missing one of: $(red --create-release-candidate), $(red --test), $(red --seal-jars),
$(red --create-email)"
++  fail "Missing one of: $(red --create-release-candidate), $(red --test), $(red --create-email)"
  fi
  

http://git-wip-us.apache.org/repos/asf/accumulo/blob/4922ed7d/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index e7bb0f6,cf1f172..318c32c
--- a/pom.xml
+++ b/pom.xml
@@@ -124,10 -121,10 +124,12 @@@
      <accumulo.release.version>${project.version}</accumulo.release.version>
      <!-- bouncycastle version for test dependencies -->
      <bouncycastle.version>1.50</bouncycastle.version>
 +    <!-- Curator version -->
 +    <curator.version>2.7.1</curator.version>
      <!-- relative path for Eclipse format; should override in child modules if necessary
-->
      <eclipseFormatterStyle>${project.parent.basedir}/contrib/Eclipse-Accumulo-Codestyle.xml</eclipseFormatterStyle>
+     <!-- extra release args for testing -->
+     <extraReleaseArgs />
      <!-- findbugs-maven-plugin won't work on jdk8 or later; set to 3.0.0 or newer -->
      <findbugs.version>3.0.1</findbugs.version>
      <!-- surefire/failsafe plugin option -->


Mime
View raw message