Skip to content

Commit 15d249d

Browse files
committed
script and doc updates
1 parent 91c3a35 commit 15d249d

File tree

3 files changed

+51
-40
lines changed

3 files changed

+51
-40
lines changed

website/content/en/docs/contribution-guidelines/releasing.md

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ git checkout -b v1.3.x
5050
git push -u upstream v1.3.x
5151
```
5252

53-
### 2. Create and push a release commit
53+
### 1. Create and push a release commit
5454

5555
Create a new branch to push the release commit:
5656

@@ -81,23 +81,23 @@ git commit -m "Release v1.3.0"
8181
git push -u origin release-v1.3.0
8282
```
8383

84-
### 3. Create and merge a new PR
84+
### 2. Create and merge a new PR
8585

8686
Create and merge a new PR for the above commit.
8787

88-
### 4. Lock down branch `master`
88+
### 3. Lock down branch `master`
8989

9090
Lock down the `master` branch to prevent further commits before the release completes.
9191
See [this section](#locking-down-branches) for steps to do so.
9292

93-
### 5. Create and push a release tag
93+
### 4. Create and push a release tag
9494

9595
```sh
9696
make tag RELEASE_VERSION=v1.3.0
9797
git push upstream v1.3.0
9898
```
9999

100-
### 6. Fast-forward the `latest` and release branches
100+
### 5. Fast-forward the `latest` and release branches
101101

102102
The `latest` branch points to the latest release tag to keep the main website subdomain up-to-date.
103103
Run the following commands to do so:
@@ -116,29 +116,27 @@ git reset --hard tags/v1.3.0
116116
git push -f upstream v1.3.x
117117
```
118118

119-
### 7. Unlock the `master` branch
119+
### 6. Unlock the `master` branch
120120

121121
See [this guide](#unlocking-branches) for steps to do so.
122122

123+
### 7. Post release steps
124+
125+
See the [post-release section](#post-release-steps).
126+
123127

124128
## Patch releases
125129

126130
We will use the `v1.3.1` release version in this example.
127131

128-
### 1. Check out the release branch
132+
### 1. Create and push a release commit
129133

130-
The release branch should already exist for the desired minor version:
134+
Create a new branch from the release branch, which should already exist for the desired minor version,
135+
to push the release commit to:
131136

132137
```sh
133138
git checkout v1.3.x
134139
git pull
135-
```
136-
137-
### 2. Create and push a release commit
138-
139-
Create a new branch to push the release commit:
140-
141-
```sh
142140
git checkout -b release-v1.3.1
143141
```
144142

@@ -161,23 +159,23 @@ git commit -m "Release v1.3.1"
161159
git push -u origin release-v1.3.1
162160
```
163161

164-
### 3. Create and merge a new PR
162+
### 2. Create and merge a new PR
165163

166164
Create and merge a new PR for the above commit.
167165

168-
### 4. Lock down the `v1.3.x` branch
166+
### 3. Lock down the `v1.3.x` branch
169167

170168
Lock down this branch prevents further commits before the release completes.
171169
See [this section](#locking-down-branches) for steps to do so.
172170

173-
### 5. Create and push a release tag
171+
### 4. Create and push a release tag
174172

175173
```sh
176174
make tag RELEASE_VERSION=v1.3.1
177175
git push upstream v1.3.1
178176
```
179177

180-
### 6. Fast-forward the `latest` branch
178+
### 5. Fast-forward the `latest` branch
181179

182180
The `latest` branch points to the latest release tag to keep the main website subdomain up-to-date.
183181
Run the following commands to do so:
@@ -188,10 +186,13 @@ git reset --hard tags/v1.3.1
188186
git push -f upstream latest
189187
```
190188

191-
### 7. Unlock the `v1.3.x` branch
189+
### 6. Unlock the `v1.3.x` branch
192190

193191
See [this guide](#unlocking-branches) for steps to do so.
194192

193+
### 7. Post release steps
194+
195+
See the [post-release section](#post-release-steps).
195196

196197
## Further reading
197198

@@ -236,22 +237,20 @@ Make sure everyone in the relevant Slack channel is aware of the release so they
236237
237238
##### Unlocking branches
238239
239-
<<<<<<< HEAD
240-
### 11. Announce the release
240+
Unlock a branch by changing the number of required approving reviewers back to 1.
241+
242+
### Post-release steps
241243
242-
Send an email to the [mailing list][mailing-list]
244+
##### Announce the release
245+
246+
Send an email to the [mailing list][mailing-list].
243247
Post to Kubernetes slack in #kubernetes-operators and #operator-sdk-dev.
244248
245-
### 12. Bump open issues to the next release.
249+
##### Bump open issues to the next release.
246250
247251
In the [GitHub milestone][gh-milestones], bump any open issues to the
248252
following release.
249253
250-
---
251-
=======
252-
Unlock a branch by changing the number of required approving reviewers back to 1.
253-
>>>>>>> automate prerelease commit, clean up release guide
254-
255254
256255
[git]:https://git-scm.com/downloads
257256
[gpg2]:https://gnupg.org/download/
@@ -260,14 +259,6 @@ Unlock a branch by changing the number of required approving reviewers back to 1
260259
[netlify-deploy]:https://docs.netlify.com/site-deploys/overview/#deploy-summary
261260
[doc-owners]: https://github.com/operator-framework/operator-sdk/blob/master/OWNERS
262261
[release-page]:https://github.com/operator-framework/operator-sdk/releases
263-
<<<<<<< HEAD
264-
[homebrew]:https://brew.sh/
265-
[homebrew-formula]:https://github.com/Homebrew/homebrew-core/blob/master/Formula/operator-sdk.rb
266-
[homebrew-readme]:https://github.com/Homebrew/homebrew-core/blob/master/CONTRIBUTING.md#to-submit-a-version-upgrade-for-the-foo-formula
267-
[homebrew-repo]:https://github.com/Homebrew/homebrew-core
268-
[sdk-samples-repo]:https://github.com/operator-framework/operator-sdk-samples
262+
[backports]:/docs/upgrading-sdk-version/backport-policy
269263
[mailing-list]:https://groups.google.com/g/operator-framework
270264
[gh-milestones]:https://github.com/operator-framework/operator-sdk/milestones
271-
=======
272-
[backports]:/docs/upgrading-sdk-version/backport-policy
273-
>>>>>>> automate prerelease commit, clean up release guide

website/scripts/set_version.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
#!/usr/bin/env bash
22

3+
# This script updates the hugo config's "version_menu" param
4+
# to the current ${MAJOR}.${MINOR} string.
5+
36
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
7+
CONFIG_PATH="${DIR}/../config.toml"
48

59
BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)"
610
if [[ "$BRANCH_NAME" =~ v[0-9]+\.[0-9]+\.x ]]; then
711
VERSION_MENU="$(echo $BRANCH_NAME | awk -F. '{ print v$1"."$2 }')"
8-
sed -i -E 's/version_menu = ".+"/version_menu = "'${VERSION_MENU}'"/g' "${DIR}"/../config.toml
12+
sed -i -E 's/version_menu = ".+"/version_menu = "'${VERSION_MENU}'"/g' "$CONFIG_PATH"
13+
14+
# Ensure config.toml was updated.
15+
if ! grep -q "version_menu = \"${VERSION_MENU}\"" "$CONFIG_PATH"; then
16+
echo "$0 failed to update config.toml"
17+
exit 1
18+
fi
919
fi

website/scripts/update_mappings.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env bash
22

3+
# This script writes a branch-to-subdomain mapping for the previously created
4+
# release branch to the hugo config. This change should be committed in the prerelease commit.
5+
36
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
7+
CONFIG_PATH="${DIR}/../config.toml"
48

59
VERSION="${1?"A Version is required"}"
610
VERSION_PATCHLESS="$(echo $VERSION | awk -F. '{ print v$1"."$2 }')"
@@ -14,4 +18,10 @@ fi
1418
MARKER="##RELEASE_ADDME##"
1519
PARAMS_VERSION="[[params.versions]]\\n version = \"${VERSION_PATCHLESS}\"\\n url = \"https://${VERSION_X_DOMAIN}.sdk.operatorframework.io\""
1620

17-
sed -i -E $'s@'${MARKER}'@'"${MARKER}\\n\\n${PARAMS_VERSION}"'@g' "${DIR}"/../config.toml
21+
sed -i -E $'s@'${MARKER}'@'"${MARKER}\\n\\n${PARAMS_VERSION}"'@g' "$CONFIG_PATH"
22+
23+
# Ensure config.toml was updated.
24+
if ! grep -q "url = \"https://${VERSION_X_DOMAIN}.sdk.operatorframework.io\"" "$CONFIG_PATH"; then
25+
echo "$0 failed to update config.toml"
26+
exit 1
27+
fi

0 commit comments

Comments
 (0)