Skip to content

Commit 8e230a1

Browse files
authored
Update update-version (#1083)
Signed-off-by: Rob Hundley <[email protected]>
1 parent 1002743 commit 8e230a1

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ MARKDOWN_LINT_WHITELIST=https://quay.io/cnr
3939

4040
TESTARGS_DEFAULT := "-v"
4141
export TESTARGS ?= $(TESTARGS_DEFAULT)
42-
BUNDLE_VERSION ?= $(shell cat ./internal/version/version.go | grep "Version =" | awk '{ print $$3}' | tr -d '"')
42+
BUNDLE_VERSION ?= $(shell grep "Version =" ./internal/version/version.go | cut -d'"' -f2)
4343
VERSION ?= $(BUNDLE_VERSION)
4444

4545
LOCAL_OS := $(shell uname)

common/scripts/multiarch_image.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ALL_PLATFORMS="amd64 ppc64le s390x"
2424
IMAGE_REPO=${1}
2525
IMAGE_NAME=${2}
2626
VERSION=${3-"$(git describe --exact-match 2> /dev/null || git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8)"}
27-
RELEASE_VERSION=${4:-4.14.0}
27+
RELEASE_VERSION=${4:-"$(grep "Version =" ./internal/version/version.go | cut -d'"' -f2)"}
2828
MAX_PULLING_RETRY=${MAX_PULLING_RETRY-10}
2929
RETRY_INTERVAL=${RETRY_INTERVAL-10}
3030
# support other container tools, e.g. podman

hack/update_operator_version

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ export CPOPEN_LOCATION="icr.io/cpopen"
2929
export PRODUCTION_IMAGE="${CPOPEN_LOCATION}/ibm-iam-operator"
3030

3131

32-
echo "Update the version.go"
32+
echo "Update go files"
3333
current_version="$(grep 'Version =' "${REPO_ROOT}/internal/version/version.go" | cut -f2 -d\")"
3434
sed s/$current_version/$VERSION/ $REPO_ROOT/internal/version/version.go > $REPO_ROOT/internal/version/version.go.new
3535
mv $REPO_ROOT/internal/version/version.go.new $REPO_ROOT/internal/version/version.go
36+
sed s/$current_version/$VERSION/ $REPO_ROOT/internal/database/schema/v1/tables_test.go > $REPO_ROOT/internal/database/schema/v1/tables_test.go.new
37+
mv $REPO_ROOT/internal/database/schema/v1/tables_test.go.new $REPO_ROOT/internal/database/schema/v1/tables_test.go
38+
3639

3740

3841
echo "Update the containerImage and olm.skipRange annotations in dev and patch"
@@ -65,11 +68,20 @@ $LOCALBIN/yq -i '.spec.*.imageTag = env(VERSION)' \
6568
"${REPO_ROOT}/config/samples/overlays/prod/authentication_image_patch.yaml"
6669
cp "${REPO_ROOT}/config/samples/overlays/prod/authentication_image_patch.yaml" "${REPO_ROOT}/config/samples/overlays/dev/authentication_image_patch.yaml"
6770

71+
echo "Making the bundle"
72+
make bundle
73+
6874
echo "Update chart versions"
6975
$LOCALBIN/yq -i '.appVersion = env(VERSION), .version = env(VERSION)' "${REPO_ROOT}/helm/Chart.yaml"
76+
$LOCALBIN/yq -i '.operator.imageTag = env(VERSION) | .operands.platformIdentityProvider.imageTag = env(VERSION) | .operands.platformAuthService.imageTag = env(VERSION) | .operands.platformIdentityManagement.imageTag = env(VERSION) | .operands.imInitContainer.imageTag = env(VERSION)' "${REPO_ROOT}/helm/values.yaml"
7077
$LOCALBIN/yq -i '.appVersion = env(VERSION), .version = env(VERSION)' "${REPO_ROOT}/helm-cluster-scoped/Chart.yaml"
71-
72-
echo "Making the bundle"
73-
make bundle
78+
sed s/$current_version/$VERSION/ $REPO_ROOT/helm/templates/10-deployment.yaml > $REPO_ROOT/helm/templates/10-deployment.yaml.new
79+
mv $REPO_ROOT/helm/templates/10-deployment.yaml.new $REPO_ROOT/helm/templates/10-deployment.yaml
80+
81+
echo "Update READMEs"
82+
sed s/$current_version/$VERSION/ $REPO_ROOT/README.md > $REPO_ROOT/README.md.new
83+
mv $REPO_ROOT/README.md.new $REPO_ROOT/README.md
84+
sed s/$current_version/$VERSION/ $REPO_ROOT/DEVELOPMENT.md > $REPO_ROOT/DEVELOPMENT.md.new
85+
mv $REPO_ROOT/DEVELOPMENT.md.new $REPO_ROOT/DEVELOPMENT.md
7486

7587
echo "Done"

0 commit comments

Comments
 (0)