Skip to content

Commit b1677ef

Browse files
committed
Enhance bump-version.sh to accept version as argument
1 parent f21095c commit b1677ef

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

hack/bump-version.sh

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
#!/bin/bash
22

3-
yq -i ".spec.version=\"${VERSION:-1.0.0}\"" config/manifests/bases/multiarch-tuning-operator.clusterserviceversion.yaml
4-
yq -i ".metadata.name=\"multiarch-tuning-operator.v${VERSION:-1.0.0}\"" config/manifests/bases/multiarch-tuning-operator.clusterserviceversion.yaml
5-
yq -i ".spec.startingCSV=\"multiarch-tuning-operator.v${VERSION:-1.0.0}\"" deploy/base/operators.coreos.com/subscriptions/openshift-multiarch-tuning-operator/subscription.yaml
6-
sed -i "s/^LABEL release=.*/LABEL release=\"${VERSION:-1.0.0}\"/" Dockerfile
7-
sed -i "s/^LABEL version=.*/LABEL version=\"${VERSION:-1.0.0}\"/" Dockerfile
8-
sed -i "s/^LABEL release=.*/LABEL release=\"${VERSION:-1.0.0}\"/" konflux.Dockerfile
9-
sed -i "s/^LABEL version=.*/LABEL version=\"${VERSION:-1.0.0}\"/" konflux.Dockerfile
10-
sed -i "s/^VERSION ?= .*/VERSION ?= ${VERSION:-1.0.0}/" Makefile
3+
set -e
4+
5+
# Accept version as first argument, fall back to VERSION env var, or show usage
6+
if [ -n "$1" ]; then
7+
VERSION="$1"
8+
elif [ -z "$VERSION" ]; then
9+
echo "Usage: $0 <version>"
10+
echo " or set VERSION environment variable"
11+
echo "Example: $0 1.2.1"
12+
exit 1
13+
fi
14+
15+
echo "Bumping version to: $VERSION"
16+
17+
yq -i ".spec.version=\"${VERSION}\"" config/manifests/bases/multiarch-tuning-operator.clusterserviceversion.yaml
18+
yq -i ".metadata.name=\"multiarch-tuning-operator.v${VERSION}\"" config/manifests/bases/multiarch-tuning-operator.clusterserviceversion.yaml
19+
yq -i ".spec.startingCSV=\"multiarch-tuning-operator.v${VERSION}\"" deploy/base/operators.coreos.com/subscriptions/openshift-multiarch-tuning-operator/subscription.yaml
20+
yq -i ".entries[0].name=\"multiarch-tuning-operator.v${VERSION}\"" index.base.yaml
21+
sed -i "s/^LABEL release=.*/LABEL release=\"${VERSION}\"/" Dockerfile
22+
sed -i "s/^LABEL version=.*/LABEL version=\"${VERSION}\"/" Dockerfile
23+
sed -i "s/^LABEL release=.*/LABEL release=\"${VERSION}\"/" konflux.Dockerfile
24+
sed -i "s/^LABEL version=.*/LABEL version=\"${VERSION}\"/" konflux.Dockerfile
25+
sed -i "s/^VERSION ?= .*/VERSION ?= ${VERSION}/" Makefile
1126
make bundle

0 commit comments

Comments
 (0)