File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -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+
48CURRENT_BRANCH=$( git rev-parse --abbrev-ref HEAD)
59
610# Ensure we are not on the `main` branch.
711if [[ " $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
1014fi
1115
1216# Ensure the index is clean
@@ -16,8 +20,12 @@ if ! git diff-index --quiet HEAD --; then
1620fi
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."
2129fi
2230
2331# Search for githubusercontent urls and replace the branch reference with a placeholder variable
You can’t perform that action at this time.
0 commit comments