Skip to content

Commit 463f668

Browse files
[v1.5.x] docs/installation: use version in download URL (#4685)
docs/installation: use version in download URL release/Makefile,website/scripts: include script to update download URL as a part of prerelease steps Signed-off-by: Eric Stroczynski <[email protected]> Co-authored-by: Eric Stroczynski <[email protected]>
1 parent 98f30d5 commit 463f668

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

release/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ endif
3939
.PHONY: prerelease
4040
prerelease: check_release_version changelog ## Create release commit changes to commit.
4141
./website/scripts/update_branch_mappings.sh $(RELEASE_VERSION)
42+
./website/scripts/update_download_url.sh $(RELEASE_VERSION)
4243

4344
.PHONY: changelog
4445
changelog: check_release_version ## Generate the changelog.

website/content/en/docs/installation/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export OS=$(uname | awk '{print tolower($0)}')
3636
Download the binary for your platform:
3737

3838
```sh
39-
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/latest/download
39+
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/v1.5.0
4040
curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
4141
```
4242

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
# This script updates the operator-sdk download link with the current release version.
4+
# This change should be committed in the prerelease commit.
5+
6+
set -e
7+
8+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
9+
DOC_PATH="${DIR}/../content/en/docs/installation/_index.md"
10+
11+
VERSION="${1?"A Version is required"}"
12+
13+
TARGET="export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/"
14+
15+
sed -i -E 's@('"${TARGET}"').+@\1'"${VERSION}"'@g' "$DOC_PATH"
16+
17+
# Ensure the file was updated.
18+
if ! grep -q "${TARGET}${VERSION}" "$DOC_PATH"; then
19+
echo "$0 failed to update ${DOC_PATH}"
20+
exit 1
21+
fi

0 commit comments

Comments
 (0)