You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by on...@apache.org on 2020/04/27 07:26:01 UTC
[geode] branch develop updated: GEODE-7999: make support branches
publish snapshots (#4996)
This is an automated email from the ASF dual-hosted git repository.
onichols pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 33ae60f GEODE-7999: make support branches publish snapshots (#4996)
33ae60f is described below
commit 33ae60faef6d7c749246d9f0dd4f42baecb403b2
Author: Owen Nichols <34...@users.noreply.github.com>
AuthorDate: Mon Apr 27 00:25:38 2020 -0700
GEODE-7999: make support branches publish snapshots (#4996)
*make support branches publish snapshots
* add missing step to update examples version when creating new support branch
* update copyright year (both at branch creation and RC creation)
---
ci/pipelines/geode-build/jinja.template.yml | 8 +--
dev-tools/release/README.md | 1 +
dev-tools/release/commit_rc.sh | 11 +++-
dev-tools/release/create_support_branches.sh | 60 +++++++++++++++--
dev-tools/release/prepare_rc.sh | 16 ++++-
dev-tools/release/promote_rc.sh | 3 +-
dev-tools/release/set_copyright.sh | 57 ++++++++++++++++
dev-tools/release/set_versions.sh | 98 +++++++++++++++-------------
8 files changed, 195 insertions(+), 59 deletions(-)
diff --git a/ci/pipelines/geode-build/jinja.template.yml b/ci/pipelines/geode-build/jinja.template.yml
index b797759..1d88496 100644
--- a/ci/pipelines/geode-build/jinja.template.yml
+++ b/ci/pipelines/geode-build/jinja.template.yml
@@ -98,7 +98,7 @@ groups:
- {{ build_test.name }}
{{- all_gating_jobs() | indent(2) }}
- UpdatePassingTokens
- {%- if repository.upstream_fork != "apache" or repository.branch == "develop" %}
+ {%- if repository.upstream_fork != "apache" or repository.branch == "develop" or repository.branch.startswith("support/") %}
- PublishArtifacts
{%- endif %}
{%- for flavor in (benchmarks.flavors) %}
@@ -113,7 +113,7 @@ groups:
{%- endfor -%}
{%- endfor %}
- UpdatePassingTokens
- {%- if repository.upstream_fork != "apache" or repository.branch == "develop" %}
+ {%- if repository.upstream_fork != "apache" or repository.branch == "develop" or repository.branch.startswith("support/") %}
- PublishArtifacts
{%- endif %}
{%- for flavor in (benchmarks.flavors) %}
@@ -398,7 +398,7 @@ jobs:
- get: alpine-tools-image
- get: geode
passed: &update-token-passed-anchor
-{%- if repository.upstream_fork != "apache" or repository.branch == "develop" %}
+{%- if repository.upstream_fork != "apache" or repository.branch == "develop" or repository.branch.startswith("support/") %}
- PublishArtifacts
{% else %}
{% for flavor in (benchmarks.flavors) %}
@@ -519,7 +519,7 @@ jobs:
- name: concourse-metadata-resource
- name: results
{% endfor %}
-{% if repository.upstream_fork != "apache" or repository.branch == "develop" %}
+{% if repository.upstream_fork != "apache" or repository.branch == "develop" or repository.branch.startswith("support/") %}
- name: PublishArtifacts
public: true
plan:
diff --git a/dev-tools/release/README.md b/dev-tools/release/README.md
index 5c79d74..98f641b 100644
--- a/dev-tools/release/README.md
+++ b/dev-tools/release/README.md
@@ -10,6 +10,7 @@ These scripts are intended to be run from the parent directory of your geode dev
Overview of scripts:
create_support_branches.sh: cuts support/x.y from develop for all projects and walks you through creating pipelines and setting version numbers
+ set_copyright.sh updates the copyright year
set_versions.sh: updates files that need to contain the version number planned for the next release from this support branch
prepare_rc.sh: Checks out the various geode repos, builds a release candidate, and publishes to nexus staging repo
commit_rc.sh: Pushes the tags and artifacts staged by prepare_rc.sh and then runs print_rc_email.sh
diff --git a/dev-tools/release/commit_rc.sh b/dev-tools/release/commit_rc.sh
index e25ea5f..e60822f 100755
--- a/dev-tools/release/commit_rc.sh
+++ b/dev-tools/release/commit_rc.sh
@@ -109,12 +109,21 @@ set +x
echo ""
echo "============================================================"
-echo "Pushing tags..."
+echo "Re-adding -SNAPSHOT in case this is not the final RC"
echo "============================================================"
+set -x
+${0%/*}/set_versions.sh -v ${VERSION} -s -n -w "${WORKSPACE}"
+set +x
+
+echo ""
+echo "============================================================"
+echo "Pushing copyrights, versions, and tags..."
+echo "============================================================"
for DIR in ${GEODE} ${GEODE_EXAMPLES} ${GEODE_NATIVE} ${GEODE_BENCHMARKS} ; do
set -x
cd ${DIR}
+ git push -u origin
git push origin rel/v${FULL_VERSION}
set +x
done
diff --git a/dev-tools/release/create_support_branches.sh b/dev-tools/release/create_support_branches.sh
index 5b481f1..63a7a63 100755
--- a/dev-tools/release/create_support_branches.sh
+++ b/dev-tools/release/create_support_branches.sh
@@ -67,6 +67,7 @@ WORKSPACE=$PWD/support-${VERSION_MM}-workspace
GEODE=$WORKSPACE/geode
GEODE_DEVELOP=$WORKSPACE/geode-develop
GEODE_EXAMPLES=$WORKSPACE/geode-examples
+GEODE_EXAMPLES_DEVELOP=$WORKSPACE/geode-examples-develop
GEODE_NATIVE=$WORKSPACE/geode-native
GEODE_BENCHMARKS=$WORKSPACE/geode-benchmarks
set +x
@@ -97,6 +98,7 @@ set -x
git clone --single-branch --branch develop git@github.com:apache/geode.git
git clone --single-branch --branch develop git@github.com:apache/geode.git geode-develop
git clone --single-branch --branch develop git@github.com:apache/geode-examples.git
+git clone --single-branch --branch develop git@github.com:apache/geode-examples.git geode-examples-develop
git clone --single-branch --branch develop git@github.com:apache/geode-native.git
git clone --single-branch --branch develop git@github.com:apache/geode-benchmarks.git
set +x
@@ -110,6 +112,27 @@ function failMsg2 {
trap 'failMsg2 $LINENO' ERR
+set -x
+${0%/*}/set_copyright.sh ${GEODE} ${GEODE_DEVELOP} ${GEODE_EXAMPLES} ${GEODE_EXAMPLES_DEVELOP} ${GEODE_NATIVE} ${GEODE_BENCHMARKS}
+set +x
+
+
+echo ""
+echo "============================================================"
+echo "Pushing copyright updates (if any) to develop before branching"
+echo "============================================================"
+#get these 2 done before the branch so we don't have to do develop and support separately.
+#the other 2 will be pushed to develop and support versions when version bumps are pushed.
+for DIR in ${GEODE_NATIVE} ${GEODE_BENCHMARKS} ; do
+ set -x
+ cd ${DIR}
+ if ! [ git push --dry-run 2>&1 | grep -q 'Everything up-to-date' ] ; then
+ git push -u origin
+ fi
+ set +x
+done
+
+
echo ""
echo "============================================================"
echo "Creating support/${VERSION_MM} branches"
@@ -118,7 +141,7 @@ for DIR in ${GEODE} ${GEODE_EXAMPLES} ${GEODE_NATIVE} ${GEODE_BENCHMARKS} ; do
set -x
cd ${DIR}
git checkout -b support/${VERSION_MM}
- git push -u origin HEAD
+ git push -u origin
set +x
done
@@ -129,7 +152,7 @@ echo "Bumping version on develop to ${NEWVERSION}"
echo "============================================================"
set -x
cd ${GEODE_DEVELOP}
-git pull
+git pull -r
git remote add myfork git@github.com:${GITHUB_USER}/geode.git || true
git checkout -b roll-develop-to-${NEWVERSION}
set +x
@@ -137,8 +160,8 @@ set +x
#version = 1.13.0-SNAPSHOT
sed -e "s/^version =.*/version = ${NEWVERSION}-SNAPSHOT/" -i.bak gradle.properties
-# initial_version: 1.12.0
-sed -e "s/^ initial_version:.*/ initial_version: ${NEWVERSION}/" -i.bak ./ci/pipelines/shared/jinja.variables.yml
+# initial_version: 1.13.0-SNAPSHOT
+sed -e "s/^ initial_version:.*/ initial_version: ${NEWVERSION}-SNAPSHOT/" -i.bak ./ci/pipelines/shared/jinja.variables.yml
VER=geode-serialization/src/main/java/org/apache/geode/internal/serialization/Version.java
#add the new ordinal and Version constants and set them as current&highest
@@ -181,8 +204,6 @@ set -x
git add .
git diff --staged
-./gradlew clean
-./gradlew build -Dskip.tests=true
./gradlew updateExpectedPom
git commit -a -m "roll develop to ${NEWVERSION} now that support/${VERSION_MM} has been created"
@@ -192,10 +213,34 @@ set +x
echo ""
echo "============================================================"
+echo "Bumping examples version on develop to ${NEWVERSION}"
+echo "============================================================"
+set -x
+cd ${GEODE_EXAMPLES_DEVELOP}
+git pull -r
+set +x
+
+#version = 1.13.0-SNAPSHOT
+#geodeVersion = 1.13.0-SNAPSHOT
+sed \
+ -e "s/^version =.*/version = ${NEWVERSION}-SNAPSHOT/" \
+ -e "s/^geodeVersion =.*/geodeVersion = ${NEWVERSION}-SNAPSHOT/" \
+ -i.bak gradle.properties
+rm gradle.properties.bak
+set -x
+git add gradle.properties
+git diff --staged
+git commit -m "point develop examples to ${NEWVERSION}-SNAPSHOT now that support/${VERSION_MM} has been created"
+git push -u origin
+set +x
+
+
+echo ""
+echo "============================================================"
echo "Setting version on support/${VERSION_MM}"
echo "============================================================"
set -x
-${0%/*}/set_versions.sh -v ${VERSION_MM}.0
+${0%/*}/set_versions.sh -v ${VERSION_MM}.0 -s -w "${WORKSPACE}"
set +x
@@ -218,3 +263,4 @@ echo "1. Go to https://github.com/${GITHUB_USER}/geode/pull/new/roll-develop-to-
echo "2. Plus the BumpMinor job at https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-develop-main?group=Semver%20Management"
echo "3. Add the new version to Jira at https://issues.apache.org/jira/projects/GEODE?selectedItem=com.atlassian.jira.jira-projects-plugin:release-page"
echo "4. (cd ${GEODE}/ci/pipelines/meta && ./deploy_meta.sh) #takes about 2 hours. keep re-running until successful."
+echo "5. That's it for now. Once all needed fixes have been proposed and cherry-picked to support/${VERSION_MM} and https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-support-${VERSION_MM/./-}-main is green, come back and run ${0%/*}/prepare_rc.sh -v ${VERSION}.RC1"
diff --git a/dev-tools/release/prepare_rc.sh b/dev-tools/release/prepare_rc.sh
index 8039293..1145c0c 100755
--- a/dev-tools/release/prepare_rc.sh
+++ b/dev-tools/release/prepare_rc.sh
@@ -98,7 +98,6 @@ fi
set -x
WORKSPACE=$PWD/release-${VERSION}-workspace
GEODE=$WORKSPACE/geode
-GEODE_DEVELOP=$WORKSPACE/geode-develop
GEODE_EXAMPLES=$WORKSPACE/geode-examples
GEODE_NATIVE=$WORKSPACE/geode-native
GEODE_BENCHMARKS=$WORKSPACE/geode-benchmarks
@@ -147,6 +146,21 @@ svn update --set-depth infinity --parents dist/dev/geode
set +x
+set -x
+${0%/*}/set_copyright.sh ${GEODE} ${GEODE_EXAMPLES} ${GEODE_NATIVE} ${GEODE_BENCHMARKS}
+
+set +x
+
+
+echo ""
+echo "============================================================"
+echo "Removing -SNAPSHOT"
+echo "============================================================"
+set -x
+${0%/*}/set_versions.sh -v ${VERSION} -n -w ${WORKSPACE}
+set +x
+
+
echo ""
echo "============================================================"
echo "Building geode..."
diff --git a/dev-tools/release/promote_rc.sh b/dev-tools/release/promote_rc.sh
index 2e0d0f0..80a1e74 100755
--- a/dev-tools/release/promote_rc.sh
+++ b/dev-tools/release/promote_rc.sh
@@ -437,5 +437,6 @@ PATCH="${VERSION##*.}"
[ "${PATCH}" -ne 0 ] || echo "9. Ask on the dev list for a volunteer to begin the chore of updating 3rd-party dependency versions on develop"
M=$(date --date '+9 months' '+%a, %B %d %Y' 2>/dev/null || date -v +9m "+%a, %B %d %Y" 2>/dev/null || echo "9 months from now")
[ "${PATCH}" -ne 0 ] || echo "10. Mark your calendar for $M to run ${0%/*}/end_of_support.sh -v ${VERSION_MM}"
-echo "Run ${0%/*}/set_versions.sh -v ${VERSION_MM}.$(( PATCH + 1 ))"
+echo "Bump support pipeline to ${VERSION_MM}.$(( PATCH + 1 )) by plussing BumpPatch in https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-support-${VERSION_MM//./-}-main?group=Semver%20Management"
+echo "Run ${0%/*}/set_versions.sh -v ${VERSION_MM}.$(( PATCH + 1 )) -s"
echo "Finally, send announce email!"
diff --git a/dev-tools/release/set_copyright.sh b/dev-tools/release/set_copyright.sh
new file mode 100755
index 0000000..e67db47
--- /dev/null
+++ b/dev-tools/release/set_copyright.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+#
+# 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
+
+usage() {
+ echo "Usage: set_copyright.sh dirs"
+ exit 1
+}
+
+if [[ "$1" == "" ]] ; then
+ usage
+fi
+
+function failMsg {
+ errln=$1
+ echo "ERROR: set_copyright script did NOT complete successfully"
+ echo "Comment out any steps that already succeeded (approximately lines 37-$(( errln - 1 ))) and try again"
+}
+trap 'failMsg $LINENO' ERR
+
+
+echo ""
+echo "============================================================"
+echo "Checking Copyright NOTICE and updating year if necessary"
+echo "============================================================"
+set -x
+year=$(date +%Y)
+for DIR in $@ ; do
+ cd ${DIR}
+ sed \
+ -e "2s/ \(20[0-9][0-9]\) / \1-${year} /" \
+ -e "2s/-20[0-9][0-9] /-${year} /" \
+ -e "2s/${year}-${year}/${year}/" \
+ -i.bak NOTICE
+ rm -f NOTICE.bak
+ git add NOTICE
+ git diff --staged
+ if [ $(git diff --staged | wc -l) -gt 0 ] ; then
+ git commit -a -m "Bumping copyright year to ${year}"
+ fi
+done
+set +x
diff --git a/dev-tools/release/set_versions.sh b/dev-tools/release/set_versions.sh
index f1c79bd..be34b15 100755
--- a/dev-tools/release/set_versions.sh
+++ b/dev-tools/release/set_versions.sh
@@ -18,18 +18,29 @@
set -e
usage() {
- echo "Usage: set_versions.sh -v version_number"
+ echo "Usage: set_versions.sh -v version_number [-s]"
echo " -v The #.#.# version number for the next release"
+ echo " -s append -SNAPSHOT to version number"
exit 1
}
FULL_VERSION=""
-while getopts ":v:" opt; do
+while getopts ":v:snw:" opt; do
case ${opt} in
v )
VERSION=$OPTARG
;;
+ s )
+ SNAPSHOT="-SNAPSHOT"
+ ;;
+ n )
+ NOPUSH=true
+ ;;
+ w )
+ WORKSPACE="$OPTARG"
+ CLEAN=false
+ ;;
\? )
usage
;;
@@ -48,43 +59,45 @@ fi
VERSION_MM=${VERSION%.*}
set -x
-WORKSPACE=$PWD/release-${VERSION}-workspace
+[ -n "${WORKSPACE}" ] || WORKSPACE=$PWD/release-${VERSION}-workspace
GEODE=$WORKSPACE/geode
GEODE_EXAMPLES=$WORKSPACE/geode-examples
set +x
function failMsg1 {
- echo "ERROR: script did NOT complete successfully. Please try again."
+ echo "ERROR: set_versions script did NOT complete successfully. Please try again."
}
trap failMsg1 ERR
-echo ""
-echo "============================================================"
-echo "Cleaning workspace directory..."
-echo "============================================================"
-set -x
-rm -rf $WORKSPACE
-mkdir -p $WORKSPACE
-cd $WORKSPACE
-set +x
-
-
-echo ""
-echo "============================================================"
-echo "Cloning repositories..."
-echo "============================================================"
-set -x
-git clone --single-branch --branch support/${VERSION_MM} git@github.com:apache/geode.git
-git clone --single-branch --branch support/${VERSION_MM} git@github.com:apache/geode-examples.git
-set +x
+if [ "${CLEAN}" != "false" ] ; then
+ echo ""
+ echo "============================================================"
+ echo "Cleaning workspace directory..."
+ echo "============================================================"
+ set -x
+ rm -rf $WORKSPACE
+ mkdir -p $WORKSPACE
+ cd $WORKSPACE
+ set +x
+
+
+ echo ""
+ echo "============================================================"
+ echo "Cloning repositories..."
+ echo "============================================================"
+ set -x
+ git clone --single-branch --branch support/${VERSION_MM} git@github.com:apache/geode.git
+ git clone --single-branch --branch support/${VERSION_MM} git@github.com:apache/geode-examples.git
+ set +x
+fi
function failMsg2 {
errln=$1
- echo "ERROR: script did NOT complete successfully"
- echo "Comment out any steps that already succeeded (approximately lines 63-$(( errln - 1 ))) and try again"
+ echo "ERROR: set_versions script did NOT complete successfully"
+ echo "Comment out any steps that already succeeded (approximately lines 74-$(( errln - 1 ))) and try again"
}
trap 'failMsg2 $LINENO' ERR
@@ -99,25 +112,21 @@ git pull
set +x
#version = 1.13.0-SNAPSHOT
-sed -e "s/^version =.*/version = ${VERSION}/" -i.bak gradle.properties
-
-#SEMVER_PRERELEASE_TOKEN=SNAPSHOT
-sed -e 's/^SEMVER_PRERELEASE_TOKEN=.*/SEMVER_PRERELEASE_TOKEN=""/' -i.bak ci/pipelines/meta/meta.properties
-
-# initial_version: 1.12.0
-sed -e "s/^ initial_version:.*/ initial_version: ${VERSION}/" -i.bak ./ci/pipelines/shared/jinja.variables.yml
+sed -e "s/^version =.*/version = ${VERSION}${SNAPSHOT}/" -i.bak gradle.properties
-rm gradle.properties.bak ci/pipelines/meta/meta.properties.bak ci/pipelines/shared/jinja.variables.yml.bak
+rm gradle.properties.bak
set -x
-git add .
+git add gradle.properties
git diff --staged
-./gradlew clean
-./gradlew build -Dskip.tests=true
./gradlew updateExpectedPom
+git add .
+echo "$(git diff --staged | wc -l)-line diff of expected-pom changes will also be committed (not shown)"
-git commit -a -m "Bumping version to ${VERSION}"
-git push -u origin
+if [ $(git diff --staged | wc -l) -gt 0 ] ; then
+ git commit -m "Bumping version to ${VERSION}${SNAPSHOT}"
+ [ "$NOPUSH" = "true" ] || git push -u origin
+fi
set +x
@@ -132,16 +141,18 @@ set +x
#version = 1.12.0-SNAPSHOT
#geodeVersion = 1.12.0-SNAPSHOT
-sed -e "s/^version = .*/version = ${VERSION}/" \
- -e "s/^geodeVersion = .*/geodeVersion = ${VERSION}/" \
+sed -e "s/^version = .*/version = ${VERSION}${SNAPSHOT}/" \
+ -e "s/^geodeVersion = .*/geodeVersion = ${VERSION}${SNAPSHOT}/" \
-i.bak gradle.properties
rm gradle.properties.bak
set -x
git add .
git diff --staged
-git commit -m "Bumping version to ${VERSION}"
-git push -u origin
+if [ $(git diff --staged | wc -l) -gt 0 ] ; then
+ git commit -m "Bumping version to ${VERSION}${SNAPSHOT}"
+ [ "$NOPUSH" = "true" ] || git push -u origin
+fi
set +x
@@ -150,6 +161,3 @@ echo "============================================================"
echo "Done setting support versions!"
echo "============================================================"
cd ${GEODE}/../..
-PATCH=${VERSION##*.}
-[ $PATCH -eq 0 ] || echo "Bump support pipeline to ${VERSION} by plussing BumpPatch in https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-support-${VERSION_MM//./-}-main?group=Semver%20Management"
-echo "That's it for now. Once all needed fixes have been proposed and cherry-picked to support/${VERSION_MM}, come back and run ${0%/*}/prepare_rc.sh -v ${VERSION}.RC1"