Skip to content

Commit c52a1b9

Browse files
authored
post-23.7 fixes (#48)
1 parent a7fde93 commit c52a1b9

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

release/create-bugfix-tag.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ tag_operators() {
3535
cargo update --workspace
3636
make regenerate-charts
3737

38-
update_code "${operator}"
38+
update_code "$TEMP_RELEASE_FOLDER/${operator}"
3939
#-----------------------------------------------------------
4040
# ensure .j2 changes are resolved
4141
#-----------------------------------------------------------
@@ -124,13 +124,25 @@ checks() {
124124

125125
update_code() {
126126
if $PRODUCT_IMAGE_TAGS; then
127-
echo "Updating relase tag in code..."
128-
if [ -f "$TEMP_RELEASE_FOLDER/$1/tests/test-definition.yaml" ]; then
127+
echo "Updating release tag in code..."
128+
if [ -f "$1/tests/test-definition.yaml" ]; then
129129
# e.g. 2.2.4-stackable23.1 -> 2.2.4-stackable23.1.1, since the release tag will use major.minor only
130-
sed -i "s/-stackable.*/-stackable${RELEASE_TAG}/" "$TEMP_RELEASE_FOLDER/$1/tests/test-definition.yaml"
130+
sed -i "s/-stackable.*/-stackable${RELEASE_TAG}/" "$1/tests/test-definition.yaml"
131131
fi
132132
else
133-
echo "Skip updating relase tag in code..."
133+
echo "Skip updating release tag in test-definition.yaml..."
134+
fi
135+
136+
if [ -f "$1/docs/templating_vars.yaml" ]; then
137+
echo "Updating templating_vars.yaml..."
138+
#-----------------------------------------------------------------------------
139+
# this should always be done as the templating vars are used for both product
140+
# versions (can be just major.minor) and helm charts (major.minor.patch). We
141+
# assume that the tag (e.g. 23.7.1) is applied to an earlier tag in the same
142+
# release (e.g. 23.7.0) so search+replace on the major.minor tag will suffice.
143+
# TODO: this may pick up versions of external components as well.
144+
#-----------------------------------------------------------------------------
145+
yq -i "(.versions.[] | select(. == \"${RELEASE}*\")) |= \"${RELEASE_TAG}\"" "$1/docs/templating_vars.yaml"
134146
fi
135147
}
136148

release/create-release-tag.sh

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -133,37 +133,26 @@ update_code() {
133133
# Not all operators have a getting started guide
134134
# that's why we verify if templating_vars.yaml exists.
135135
if [ -f "$1/docs/templating_vars.yaml" ]; then
136-
yq -i "(.versions.[] | select(. == \"*dev\")) |= \"${RELEASE}\"" "$1/docs/templating_vars.yaml"
136+
yq -i "(.versions.[] | select(. == \"*dev\")) |= \"${RELEASE_TAG}\"" "$1/docs/templating_vars.yaml"
137137
yq -i ".helm.repo_name |= sub(\"stackable-dev\", \"stackable-stable\")" "$1/docs/templating_vars.yaml"
138138
yq -i ".helm.repo_url |= sub(\"helm-dev\", \"helm-stable\")" "$1/docs/templating_vars.yaml"
139139
fi
140140

141141
#--------------------------------------------------------------------------
142-
# Replace .spec.image.stackableVersion for getting-started examples.
143-
# N.B. yaml files should contain a single document.
142+
# Replace .spec.image.stackableVersion for kuttl tests.
143+
# Use sed as yq does not process .j2 file syntax properly.
144144
#--------------------------------------------------------------------------
145-
if [ -d "$1/docs/modules/getting_started/examples/code" ]; then
146-
for file in $(find "$1/docs/modules/getting_started/examples/code" -name "*.yaml"); do
147-
yq -i "(.spec | select(has(\"image\")).image | (select(has(\"stackableVersion\")).stackableVersion)) = \"${RELEASE}\"" "$file"
148-
done
145+
if [ -f "$1/tests/test-definition.yaml" ]; then
146+
# e.g. 2.2.4-stackable0.5.0 -> 2.2.4-stackable23.1
147+
sed -i "s/-stackable.*/-stackable${RELEASE}/" "$1/tests/test-definition.yaml"
149148
fi
150149

151-
#--------------------------------------------------------------------------
152-
# Replace .spec.image.stackableVersion for kuttl tests.
153-
# Use sed as yq does not process .j2 file syntax properly.
154-
#--------------------------------------------------------------------------
155-
# TODO old product images won't be tested any longer
156-
if [ -f "$1/tests/test-definition.yaml" ]; then
157-
# e.g. 2.2.4-stackable0.5.0 -> 2.2.4-stackable23.1
158-
sed -i "s/-stackable.*/-stackable${RELEASE}/" "$1/tests/test-definition.yaml"
159-
fi
160-
161-
#--------------------------------------------------------------------------
162-
# Replace "nightly" link so the documentation refers to the current version
163-
#--------------------------------------------------------------------------
164-
for file in $(find "$1/docs" -name "*.adoc"); do
165-
sed -i "s/nightly@home/home/g" "$file"
166-
done
150+
#--------------------------------------------------------------------------
151+
# Replace "nightly" link so the documentation refers to the current version
152+
#--------------------------------------------------------------------------
153+
for file in $(find "$1/docs" -name "*.adoc"); do
154+
sed -i "s/nightly@home/home/g" "$file"
155+
done
167156
}
168157

169158
push_branch() {

0 commit comments

Comments
 (0)