Skip to content

Commit 500f07c

Browse files
committed
feat: update update_refs.sh script to handle stackableRelease
1 parent 3bd8898 commit 500f07c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

_scripts/update_refs.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4+
# This script is used by the stackable-utils release script to update the demos
5+
# repository branch references as well as the stackableRelease versions so that
6+
# demos are properly versioned.
7+
48
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
59

610
# Ensure we are not on the `main` branch.
711
if [[ "$CURRENT_BRANCH" == "main" ]]; then
8-
>&2 echo "Will not replace github references for the main branch. Exiting."
9-
exit 1
12+
>&2 echo "Will not replace github references for the main branch. Exiting."
13+
exit 1
1014
fi
1115

1216
# Ensure the index is clean
@@ -16,8 +20,12 @@ if ! git diff-index --quiet HEAD --; then
1620
fi
1721

1822
# Warn if the branch isn't a `release-*` branch (these changes shouldn't be in a branch that gets merged to main)
19-
if [[ "$CURRENT_BRANCH" != release-* ]]; then
20-
>&2 echo "WARNING: doesn't look like a release branch. Continuing anyway."
23+
if [[ "$CURRENT_BRANCH" == release-* ]]; then
24+
STACKABLE_RELEASE="${CURRENT_BRANCH#release-}"
25+
echo "Updating stackableRelease to $STACKABLE_RELEASE"
26+
sed -i -E "s/(stackableRelease:\s+)(\S+)/\1${STACKABLE_RELEASE}/" stacks/stacks-v2.yaml
27+
else
28+
>&2 echo "WARNING: doesn't look like a release branch. Will not update stackableRelease versions in stacks."
2129
fi
2230

2331
# Search for githubusercontent urls and replace the branch reference with a placeholder variable

0 commit comments

Comments
 (0)