From 4d85e1f82c67145370cd50abe727158f29736080 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 20 Jun 2016 09:08:53 -0700 Subject: [PATCH 1/4] Adding release-jetty.sh script (for those that want it) --- scripts/release-jetty.sh | 183 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100755 scripts/release-jetty.sh diff --git a/scripts/release-jetty.sh b/scripts/release-jetty.sh new file mode 100755 index 00000000000..634481a59cf --- /dev/null +++ b/scripts/release-jetty.sh @@ -0,0 +1,183 @@ +#!/bin/bash + +echo "" +echo "-----------------------------------------------" +echo " Verify Environment" + +requiredExecutable() { + hash $1 2>/dev/null + if [ $? != 0 ] ; then + echo "ERROR: $1 not found. Install $1" + exit -1 + fi +} + +requiredExecutable "git" +requiredExecutable "xmllint" +requiredExecutable "sed" +requiredExecutable "gpg" +requiredExecutable "egrep" +requiredExecutable "mvn" + +proceedyn() { + while true; do + read -p "$1 " yn + case ${yn:-$2} in + [Yy]* ) return 0;; + [Nn]* ) return 1;; + * ) echo "Please answer yes or no.";; + esac + done +} + +echo "" +echo "-----------------------------------------------" +echo " Collect Information About Release" + +function gitFindRemoteByUrl() { + URL="$1" + for GREMOTE in $(git remote); do + git ls-remote --get-url $GREMOTE | grep "$URL" 2>&1 > /dev/null + if [ $? -eq 0 ] ; then + echo $GREMOTE + fi + done + return 0 +} + +GIT_REMOTE_URL="git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project.git" +GIT_REMOTE_ID=$(gitFindRemoteByUrl "$GIT_REMOTE_URL") +GIT_BRANCH_ID=$(git symbolic-ref -q --short HEAD || git describe --tags --exact-match) + +if [ -z "$GIT_REMOTE_ID" ] ; then + echo "ERROR: Unable to determine git remote id for $GIT_REMOTE_URL" + echo "Are you running this build from a properly cloned git local repository?" + exit -1 +fi + +# Ensure that git user is in their gpg key list +GIT_USER_EMAIL=`git config --get user.email` + +#gpg -q --list-keys "$GIT_USER_EMAIL" 2>&1 > /dev/null +#if [ $? != 0 ] ; then +# echo "ERROR: git user.email of $GIT_USER_EMAIL is not present in your gpg --list-keys" +# echo "Go ahead and make one $ gpg --gen-key" +# exit -1 +#fi + +VER_CURRENT=`sed -e "s/xmlns/ignore/" pom.xml | xmllint --xpath "/project/version/text()" -` +read -e -p "Release Version ? " VER_RELEASE +read -e -p "Next Dev Version ? " VER_NEXT +# VER_RELEASE=9.3.5.v20151012 +# VER_NEXT=9.3.6-SNAPSHOT +TAG_NAME="jetty-$VER_RELEASE" + +# Ensure tag doesn't exist (yet) +git rev-parse --quiet --verify "$TAG_NAME" 2>&1 > /dev/null +if [ $? -eq 0 ] ; then + echo "" + echo "ERROR: Git Tag $TAG_NAME already exists" + echo "" + git show -s "$TAG_NAME" + exit -1 +fi + +ALT_DEPLOY_DIR=$HOME/.m2/alt-deploy +if [ ! -d "$ALT_DEPLOY_DIR" ] ; then + mkdir -p "$ALT_DEPLOY_DIR" +fi + +DEPLOY_OPTS="-Dmaven.test.failure.ignore=true" +# DEPLOY_OPTS="-Dtest=None" +# DEPLOY_OPTS="$DEPLOY_OPTS -DaltDeploymentRepository=intarget::default::file://$ALT_DEPLOY_DIR/" + +echo "" +echo "-----------------------------------------------" +echo " Release Plan Review" +echo "" +echo "Git Remote ID : $GIT_REMOTE_ID" +echo "Git Branch ID : $GIT_BRANCH_ID" +echo "Git user.email : $GIT_USER_EMAIL" +echo "Current Version : $VER_CURRENT" +echo "Release Version : $VER_RELEASE" +echo "Next Dev Version : $VER_NEXT" +echo "Tag name : $TAG_NAME" +echo "Maven Deploy Opts: $DEPLOY_OPTS" + +reportMavenTestFailures() { + failFiles=$(egrep -lr --include="*.txt" -E "^Tests .* FAILURE" .) + oldIFS="$IFS" + IFS=' +' + IFS=${IFS:0:1} + failarray=( $failFiles ) + IFS="$oldIFS" + + for index in ${!failarray[@]}; do + echo ${failarray[index]} + cat ${failarray[index]} + done + + if [ ${#failarray[@]} -gt 0 ] ; then + echo "There are ${#failarray[@]} Test Cases with failures" + else + echo "There are no testcases with failures" + fi +} + +echo "" +if proceedyn "Are you sure you want to release using above? (y/N)" n; then + echo "" + if proceedyn "Update VERSION.txt for $VER_RELEASE? (Y/n)" y; then + mvn -N -Pupdate-version + cp VERSION.txt VERSION.txt.backup + cat VERSION.txt.backup | sed -e "s/$VER_CURRENT/$VER_RELEASE/" > VERSION.txt + rm VERSION.txt.backup + fi + + # This is equivalent to 'mvn release:prepare' + if proceedyn "Update project.versions for $VER_RELEASE? (Y/n)" y; then + mvn org.codehaus.mojo:versions-maven-plugin:2.1:set \ + -DoldVersion="$VER_CURRENT" \ + -DnewVersion="$VER_RELEASE" + fi + if proceedyn "Commit $VER_RELEASE updates? (Y/n)" y; then + git commit -a -m "Updating to version $VER_RELEASE" + fi + if proceedyn "Create Tag $TAG_NAME? (Y/n)" y; then + echo "TODO: Sign tags with GIT_USER_EMAIL=$GIT_USER_EMAIL" + git tag -m "Creating tag $TAG_NAME" $TAG_NAME + fi + + # This is equivalent to 'mvn release:perform' + if proceedyn "Build/Deploy from tag $TAG_NAME? (Y/n)" y; then + git checkout $TAG_NAME + mvn clean package source:jar javadoc:jar gpg:sign deploy \ + -Peclipse-release $DEPLOY_OPTS + reportMavenTestFailures + git checkout $GIT_BRANCH_ID + fi + if proceedyn "Update working directory for $VER_NEXT? (Y/n)" y; then + echo "Update VERSION.txt for $VER_NEXT" + cp VERSION.txt VERSION.txt.backup + echo "jetty-$VER_NEXT" > VERSION.txt + echo "" >> VERSION.txt + cat VERSION.txt.backup >> VERSION.txt + echo "Update project.versions for $VER_NEXT" + mvn org.codehaus.mojo:versions-maven-plugin:2.1:set \ + -DoldVersion="$VER_RELEASE" \ + -DnewVersion="$VER_NEXT" + echo "Commit $VER_NEXT" + if proceedyn "Commit updates in working directory for $VER_NEXT? (Y/n)" y; then + git commit -a -m "Updating to version $VER_NEXT" + fi + fi + if proceedyn "Push git commits to remote $GIT_REMOTE_ID? (Y/n)" y; then + git push $GIT_REMOTE_ID $GIT_BRANCH_ID + git push $GIT_REMOTE_ID --tags + fi +else + echo "Not performing release" +fi + + From 7b1d807e49f163f3777e9a1f03226e7472d4945f Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 20 Jun 2016 09:10:27 -0700 Subject: [PATCH 2/4] Updating version plugin --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e6b2abe108d..37f8be8d904 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,7 @@ org.eclipse.jetty.toolchain jetty-version-maven-plugin - 2.0 + 2.1 org.apache.maven.plugins From abdbd177c144c40baa18fc3562425f514b7e31a9 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 20 Jun 2016 09:12:05 -0700 Subject: [PATCH 3/4] Wrong version plugin (oops) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 37f8be8d904..e6b2abe108d 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,7 @@ org.eclipse.jetty.toolchain jetty-version-maven-plugin - 2.1 + 2.0 org.apache.maven.plugins From 62effb73d38b046e64ab485f5a8163ef50c1c767 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 20 Jun 2016 09:56:21 -0700 Subject: [PATCH 4/4] Removing duplicate entries in VERSION.txt --- VERSION.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index ef17b61a9ee..62a0cc502ad 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -7,12 +7,6 @@ jetty-9.3.10.M0 - 26 May 2016 + 574 Introduce a TLS handshake completed listener + 581 Initial session recv window setting not working + 85 Expose TLS protocol used for connection in SecureRequestCustomizer - + 354 Spin loop in case of exception thrown during accept() - + 464 Improve reporting of SSLHandshakeException - + 542 Support Connection.Listener bean on clients - + 574 Introduce a TLS handshake completed listener - + 581 Initial session recv window setting not working - + 85 Expose TLS protocol used for connection in SecureRequestCustomizer jetty-9.3.9.v20160517 - 17 May 2016 + 436 Migrate Jetty Documentation