Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions hack/pre-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CVP=false
BASEIMAGE=false
DISTGIT=false
GITLAB=false
KEEP_BUNDLE_CHANGES=false

# codes for printing and resetting pink text
PINK='\033[95m'
Expand All @@ -30,6 +31,9 @@ usage() {
echo "optional flags: -g"
echo " bumps the gitlab versions"
echo -e " ${PINK}Requires connection to the RedHat VPN"
echo "optional flags: -k"
echo " keep all changes from 'make bundle' including RBAC regeneration"
echo " (default: only keep version-related changes, revert RBAC changes)"
printf "${START_COLOR}"
}

Expand Down Expand Up @@ -231,6 +235,16 @@ github_update() {
sed -i 's/REPLACE_IMAGE:latest/REPLACE_IMAGE/' bundle/manifests/windows-machine-config-operator.clusterserviceversion.yaml
sed -i "s/operator-sdk-v1.14.0+git/operator-sdk-$OPERATOR_SDK_VERSION+git/" bundle/manifests/windows-machine-config-operator.clusterserviceversion.yaml

# Revert unintended RBAC changes from make bundle unless -k flag is set
if [[ $KEEP_BUNDLE_CHANGES == "false" ]]; then
echo "Reverting RBAC changes from make bundle (use -k flag to keep all changes)"
git checkout HEAD -- bundle/manifests/prometheus-k8s_rbac.authorization.k8s.io_v1_role.yaml \
bundle/manifests/system-wicd-nodes_rbac.authorization.k8s.io_v1_clusterrole.yaml \
config/rbac/role.yaml 2>/dev/null || true
else
echo "Keeping all changes from make bundle including RBAC regeneration"
fi

commit_message="[$base_branch] Update version to $updated_version

This commit was generated by hack/pre-release.sh"
Expand Down Expand Up @@ -424,14 +438,15 @@ if [[ "$operator_sdk_current_version" != "$OPERATOR_SDK_VERSION" ]]; then
exit
fi

# This sets the CVP and baseimage flags
while getopts "bcdg" opt; do
case "$opt" in
# This sets the CVP, baseimage, and other flags
while getopts "bcdgk" opt; do
case "$opt" in
c) CVP=true;;
b) BASEIMAGE=true;;
d) DISTGIT=true;;
g) GITLAB=true;;
esac
k) KEEP_BUNDLE_CHANGES=true;;
esac
done
shift $((OPTIND-1))

Expand Down