Skip to content

Commit 33ae60f

Browse files
GEODE-7999: make support branches publish snapshots (apache#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)
1 parent edcc077 commit 33ae60f

File tree

8 files changed

+195
-59
lines changed

8 files changed

+195
-59
lines changed

ci/pipelines/geode-build/jinja.template.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ groups:
9898
- {{ build_test.name }}
9999
{{- all_gating_jobs() | indent(2) }}
100100
- UpdatePassingTokens
101-
{%- if repository.upstream_fork != "apache" or repository.branch == "develop" %}
101+
{%- if repository.upstream_fork != "apache" or repository.branch == "develop" or repository.branch.startswith("support/") %}
102102
- PublishArtifacts
103103
{%- endif %}
104104
{%- for flavor in (benchmarks.flavors) %}
@@ -113,7 +113,7 @@ groups:
113113
{%- endfor -%}
114114
{%- endfor %}
115115
- UpdatePassingTokens
116-
{%- if repository.upstream_fork != "apache" or repository.branch == "develop" %}
116+
{%- if repository.upstream_fork != "apache" or repository.branch == "develop" or repository.branch.startswith("support/") %}
117117
- PublishArtifacts
118118
{%- endif %}
119119
{%- for flavor in (benchmarks.flavors) %}
@@ -398,7 +398,7 @@ jobs:
398398
- get: alpine-tools-image
399399
- get: geode
400400
passed: &update-token-passed-anchor
401-
{%- if repository.upstream_fork != "apache" or repository.branch == "develop" %}
401+
{%- if repository.upstream_fork != "apache" or repository.branch == "develop" or repository.branch.startswith("support/") %}
402402
- PublishArtifacts
403403
{% else %}
404404
{% for flavor in (benchmarks.flavors) %}
@@ -519,7 +519,7 @@ jobs:
519519
- name: concourse-metadata-resource
520520
- name: results
521521
{% endfor %}
522-
{% if repository.upstream_fork != "apache" or repository.branch == "develop" %}
522+
{% if repository.upstream_fork != "apache" or repository.branch == "develop" or repository.branch.startswith("support/") %}
523523
- name: PublishArtifacts
524524
public: true
525525
plan:

dev-tools/release/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ These scripts are intended to be run from the parent directory of your geode dev
1010
Overview of scripts:
1111

1212
create_support_branches.sh: cuts support/x.y from develop for all projects and walks you through creating pipelines and setting version numbers
13+
set_copyright.sh updates the copyright year
1314
set_versions.sh: updates files that need to contain the version number planned for the next release from this support branch
1415
prepare_rc.sh: Checks out the various geode repos, builds a release candidate, and publishes to nexus staging repo
1516
commit_rc.sh: Pushes the tags and artifacts staged by prepare_rc.sh and then runs print_rc_email.sh

dev-tools/release/commit_rc.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,21 @@ set +x
109109

110110
echo ""
111111
echo "============================================================"
112-
echo "Pushing tags..."
112+
echo "Re-adding -SNAPSHOT in case this is not the final RC"
113113
echo "============================================================"
114+
set -x
115+
${0%/*}/set_versions.sh -v ${VERSION} -s -n -w "${WORKSPACE}"
116+
set +x
117+
114118

119+
echo ""
120+
echo "============================================================"
121+
echo "Pushing copyrights, versions, and tags..."
122+
echo "============================================================"
115123
for DIR in ${GEODE} ${GEODE_EXAMPLES} ${GEODE_NATIVE} ${GEODE_BENCHMARKS} ; do
116124
set -x
117125
cd ${DIR}
126+
git push -u origin
118127
git push origin rel/v${FULL_VERSION}
119128
set +x
120129
done

dev-tools/release/create_support_branches.sh

+53-7
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ WORKSPACE=$PWD/support-${VERSION_MM}-workspace
6767
GEODE=$WORKSPACE/geode
6868
GEODE_DEVELOP=$WORKSPACE/geode-develop
6969
GEODE_EXAMPLES=$WORKSPACE/geode-examples
70+
GEODE_EXAMPLES_DEVELOP=$WORKSPACE/geode-examples-develop
7071
GEODE_NATIVE=$WORKSPACE/geode-native
7172
GEODE_BENCHMARKS=$WORKSPACE/geode-benchmarks
7273
set +x
@@ -97,6 +98,7 @@ set -x
9798
git clone --single-branch --branch develop [email protected]:apache/geode.git
9899
git clone --single-branch --branch develop [email protected]:apache/geode.git geode-develop
99100
git clone --single-branch --branch develop [email protected]:apache/geode-examples.git
101+
git clone --single-branch --branch develop [email protected]:apache/geode-examples.git geode-examples-develop
100102
git clone --single-branch --branch develop [email protected]:apache/geode-native.git
101103
git clone --single-branch --branch develop [email protected]:apache/geode-benchmarks.git
102104
set +x
@@ -110,6 +112,27 @@ function failMsg2 {
110112
trap 'failMsg2 $LINENO' ERR
111113

112114

115+
set -x
116+
${0%/*}/set_copyright.sh ${GEODE} ${GEODE_DEVELOP} ${GEODE_EXAMPLES} ${GEODE_EXAMPLES_DEVELOP} ${GEODE_NATIVE} ${GEODE_BENCHMARKS}
117+
set +x
118+
119+
120+
echo ""
121+
echo "============================================================"
122+
echo "Pushing copyright updates (if any) to develop before branching"
123+
echo "============================================================"
124+
#get these 2 done before the branch so we don't have to do develop and support separately.
125+
#the other 2 will be pushed to develop and support versions when version bumps are pushed.
126+
for DIR in ${GEODE_NATIVE} ${GEODE_BENCHMARKS} ; do
127+
set -x
128+
cd ${DIR}
129+
if ! [ git push --dry-run 2>&1 | grep -q 'Everything up-to-date' ] ; then
130+
git push -u origin
131+
fi
132+
set +x
133+
done
134+
135+
113136
echo ""
114137
echo "============================================================"
115138
echo "Creating support/${VERSION_MM} branches"
@@ -118,7 +141,7 @@ for DIR in ${GEODE} ${GEODE_EXAMPLES} ${GEODE_NATIVE} ${GEODE_BENCHMARKS} ; do
118141
set -x
119142
cd ${DIR}
120143
git checkout -b support/${VERSION_MM}
121-
git push -u origin HEAD
144+
git push -u origin
122145
set +x
123146
done
124147

@@ -129,16 +152,16 @@ echo "Bumping version on develop to ${NEWVERSION}"
129152
echo "============================================================"
130153
set -x
131154
cd ${GEODE_DEVELOP}
132-
git pull
155+
git pull -r
133156
git remote add myfork [email protected]:${GITHUB_USER}/geode.git || true
134157
git checkout -b roll-develop-to-${NEWVERSION}
135158
set +x
136159

137160
#version = 1.13.0-SNAPSHOT
138161
sed -e "s/^version =.*/version = ${NEWVERSION}-SNAPSHOT/" -i.bak gradle.properties
139162

140-
# initial_version: 1.12.0
141-
sed -e "s/^ initial_version:.*/ initial_version: ${NEWVERSION}/" -i.bak ./ci/pipelines/shared/jinja.variables.yml
163+
# initial_version: 1.13.0-SNAPSHOT
164+
sed -e "s/^ initial_version:.*/ initial_version: ${NEWVERSION}-SNAPSHOT/" -i.bak ./ci/pipelines/shared/jinja.variables.yml
142165

143166
VER=geode-serialization/src/main/java/org/apache/geode/internal/serialization/Version.java
144167
#add the new ordinal and Version constants and set them as current&highest
@@ -181,21 +204,43 @@ set -x
181204
git add .
182205
git diff --staged
183206

184-
./gradlew clean
185-
./gradlew build -Dskip.tests=true
186207
./gradlew updateExpectedPom
187208

188209
git commit -a -m "roll develop to ${NEWVERSION} now that support/${VERSION_MM} has been created"
189210
git push -u myfork
190211
set +x
191212

192213

214+
echo ""
215+
echo "============================================================"
216+
echo "Bumping examples version on develop to ${NEWVERSION}"
217+
echo "============================================================"
218+
set -x
219+
cd ${GEODE_EXAMPLES_DEVELOP}
220+
git pull -r
221+
set +x
222+
223+
#version = 1.13.0-SNAPSHOT
224+
#geodeVersion = 1.13.0-SNAPSHOT
225+
sed \
226+
-e "s/^version =.*/version = ${NEWVERSION}-SNAPSHOT/" \
227+
-e "s/^geodeVersion =.*/geodeVersion = ${NEWVERSION}-SNAPSHOT/" \
228+
-i.bak gradle.properties
229+
rm gradle.properties.bak
230+
set -x
231+
git add gradle.properties
232+
git diff --staged
233+
git commit -m "point develop examples to ${NEWVERSION}-SNAPSHOT now that support/${VERSION_MM} has been created"
234+
git push -u origin
235+
set +x
236+
237+
193238
echo ""
194239
echo "============================================================"
195240
echo "Setting version on support/${VERSION_MM}"
196241
echo "============================================================"
197242
set -x
198-
${0%/*}/set_versions.sh -v ${VERSION_MM}.0
243+
${0%/*}/set_versions.sh -v ${VERSION_MM}.0 -s -w "${WORKSPACE}"
199244
set +x
200245

201246

@@ -218,3 +263,4 @@ echo "1. Go to https://github.com/${GITHUB_USER}/geode/pull/new/roll-develop-to-
218263
echo "2. Plus the BumpMinor job at https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-develop-main?group=Semver%20Management"
219264
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"
220265
echo "4. (cd ${GEODE}/ci/pipelines/meta && ./deploy_meta.sh) #takes about 2 hours. keep re-running until successful."
266+
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"

dev-tools/release/prepare_rc.sh

+15-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ fi
9898
set -x
9999
WORKSPACE=$PWD/release-${VERSION}-workspace
100100
GEODE=$WORKSPACE/geode
101-
GEODE_DEVELOP=$WORKSPACE/geode-develop
102101
GEODE_EXAMPLES=$WORKSPACE/geode-examples
103102
GEODE_NATIVE=$WORKSPACE/geode-native
104103
GEODE_BENCHMARKS=$WORKSPACE/geode-benchmarks
@@ -147,6 +146,21 @@ svn update --set-depth infinity --parents dist/dev/geode
147146
set +x
148147

149148

149+
set -x
150+
${0%/*}/set_copyright.sh ${GEODE} ${GEODE_EXAMPLES} ${GEODE_NATIVE} ${GEODE_BENCHMARKS}
151+
152+
set +x
153+
154+
155+
echo ""
156+
echo "============================================================"
157+
echo "Removing -SNAPSHOT"
158+
echo "============================================================"
159+
set -x
160+
${0%/*}/set_versions.sh -v ${VERSION} -n -w ${WORKSPACE}
161+
set +x
162+
163+
150164
echo ""
151165
echo "============================================================"
152166
echo "Building geode..."

dev-tools/release/promote_rc.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -437,5 +437,6 @@ PATCH="${VERSION##*.}"
437437
[ "${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"
438438
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")
439439
[ "${PATCH}" -ne 0 ] || echo "10. Mark your calendar for $M to run ${0%/*}/end_of_support.sh -v ${VERSION_MM}"
440-
echo "Run ${0%/*}/set_versions.sh -v ${VERSION_MM}.$(( PATCH + 1 ))"
440+
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"
441+
echo "Run ${0%/*}/set_versions.sh -v ${VERSION_MM}.$(( PATCH + 1 )) -s"
441442
echo "Finally, send announce email!"

dev-tools/release/set_copyright.sh

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
set -e
19+
20+
usage() {
21+
echo "Usage: set_copyright.sh dirs"
22+
exit 1
23+
}
24+
25+
if [[ "$1" == "" ]] ; then
26+
usage
27+
fi
28+
29+
function failMsg {
30+
errln=$1
31+
echo "ERROR: set_copyright script did NOT complete successfully"
32+
echo "Comment out any steps that already succeeded (approximately lines 37-$(( errln - 1 ))) and try again"
33+
}
34+
trap 'failMsg $LINENO' ERR
35+
36+
37+
echo ""
38+
echo "============================================================"
39+
echo "Checking Copyright NOTICE and updating year if necessary"
40+
echo "============================================================"
41+
set -x
42+
year=$(date +%Y)
43+
for DIR in $@ ; do
44+
cd ${DIR}
45+
sed \
46+
-e "2s/ \(20[0-9][0-9]\) / \1-${year} /" \
47+
-e "2s/-20[0-9][0-9] /-${year} /" \
48+
-e "2s/${year}-${year}/${year}/" \
49+
-i.bak NOTICE
50+
rm -f NOTICE.bak
51+
git add NOTICE
52+
git diff --staged
53+
if [ $(git diff --staged | wc -l) -gt 0 ] ; then
54+
git commit -a -m "Bumping copyright year to ${year}"
55+
fi
56+
done
57+
set +x

0 commit comments

Comments
 (0)