Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 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
3 changes: 1 addition & 2 deletions release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ENV GIT_REMOTE_NAME="${GIT_REMOTE_NAME:-origin}"
ENV PULP_OPERATOR_SOURCE_PATH="${PULP_OPERATOR_SOURCE_PATH:-/app/pulp-operator}"
ENV PULP_OPERATOR_REPLACE_VERSION="${PULP_OPERATOR_REPLACE_VERSION:-1.0.0-beta.3}"
ENV PULP_OPERATOR_RELEASE_VERSION="${PULP_OPERATOR_RELEASE_VERSION:-1.0.0-beta.4}"
ENV PULP_OPERATOR_DEV_VERSION="${PULP_OPERATOR_DEV_VERSION:-1.0.0-beta.5}"

ENV OPERATORHUB_REPO_PATH="${OPERATORHUB_REPO_PATH:-/app/community-operators}"
ENV GIT_OPERATORHUB_RELEASE_BRANCH="${GIT_OPERATORHUB_RELEASE_BRANCH:-pulp-operator-$PULP_OPERATOR_RELEASE_VERSION}"
Expand Down Expand Up @@ -46,4 +45,4 @@ COPY release.sh /app
COPY ssh_config /root/.ssh/config


ENTRYPOINT ["./release.sh"]
ENTRYPOINT ["./release.sh"]
3 changes: 0 additions & 3 deletions release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ podman build --build-arg GOLANG_VERSION=1.23.0 --build-arg CONTROLLER_TOOLS_VERS
GIT_RELEASE_BRANCH=release-beta-4
PULP_OPERATOR_REPLACE_VERSION=1.0.0-beta.3
PULP_OPERATOR_RELEASE_VERSION=1.0.0-beta.4
PULP_OPERATOR_DEV_VERSION=1.0.0-beta.5
GITHUB_SSH_KEY=~/.ssh/github
PULP_OPERATOR_REPO_PATH=/tmp/pulp-operator/
OPERATORHUB_REPO_PATH=/tmp/community-operators/
Expand All @@ -63,7 +62,6 @@ podman run -dit --name pulp-operator-release \
-e GIT_REMOTE_BRANCH \
-e PULP_OPERATOR_REPLACE_VERSION \
-e PULP_OPERATOR_RELEASE_VERSION \
-e PULP_OPERATOR_DEV_VERSION \
-e GIT_OPERATORHUB_RELEASE_BRANCH \
-e GIT_OPERATORHUB_UPSTREAM_REMOTE_NAME \
-e GIT_OPERATORHUB_REMOTE_NAME \
Expand All @@ -85,7 +83,6 @@ podman run -dit --name pulp-operator-release \
|GIT_REMOTE_NAME|`pulp-operator` fork git remote name. For example: origin|
|PULP_OPERATOR_REPLACE_VERSION|`pulp-operator` version to be replaced by this release. For example:1.0.0-beta.3|
|PULP_OPERATOR_RELEASE_VERSION|`pulp-operator` release version. For example: 1.0.0-beta.4|
|PULP_OPERATOR_DEV_VERSION|`pulp-operator` development version (version that will be worked on after this release). For example: 1.0.0-beta.5|
|GIT_OPERATORHUB_RELEASE_BRANCH|name of the release branch that will be created on `operatorhub catalog`. For example: "pulp-operator-$PULP_OPERATOR_RELEASE_VERSION"|
|GIT_OPERATORHUB_UPSTREAM_REMOTE_NAME|`operatorhub catalog` upstream git remote name. For example: upstream|
|GIT_OPERATORHUB_REMOTE_NAME|`operatorhub catalog` fork git remote name. For example: origin|
Expand Down
17 changes: 10 additions & 7 deletions release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,21 @@ function new_release {


function bump_version {
echo "Bumping main.go version ..."
sed -i -E "s/(pulp-operator version:) .*/\1 ${PULP_OPERATOR_DEV_VERSION}\")/g" main.go

echo "Bumping Makefile operator's version ..."
sed -i -E "s/^(VERSION \?=) .*/\1 ${PULP_OPERATOR_DEV_VERSION}/g" Makefile
sed -i -E "s/^(VERSION \?=) .*/\1 ${PULP_OPERATOR_RELEASE_VERSION}/g" Makefile
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what we have been essentially doing since we went GA (1.0.0). Following YAGNI, maybe bring it back when we start doing dev builds again (like a potential 2.0 release?)


echo "Bumping the tag used in bundle-upgrade pipeline ..."
sed -i -E "s/(ref:) ${PULP_OPERATOR_REPLACE_VERSION}/\1 ${PULP_OPERATOR_RELEASE_VERSION}/g" .github/workflows/ci.yml

echo "Updating the manifests with the changes ..."
make generate manifests bundle

echo "Updating containerImage annotation"
CSV_FILE=manifests/pulp-operator.clusterserviceversion.yaml
sed -i "s#containerImage: quay.io/pulp/pulp-operator:devel#containerImage: quay.io/pulp/pulp-operator:v${PULP_OPERATOR_RELEASE_VERSION}#g" $CSV_FILE
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason for CSV not to be as similar as possible between pulp-operator release, k8s community release, and openshift community release. So, this should be harmless.


echo "Commiting changes ..."
git commit -am "Bump version from Makefile to $PULP_OPERATOR_DEV_VERSION" -m "[noissue]"
git commit -am "Bump version from Makefile to $PULP_OPERATOR_RELEASE_VERSION" -m "[noissue]"
}

function stash_files {
Expand Down Expand Up @@ -66,9 +67,11 @@ function operatorhub {

cp -a ${PULP_OPERATOR_SOURCE_PATH}/bundle/* ${CATALOG_DIR}/
CSV_FILE=${CATALOG_DIR}/manifests/pulp-operator.clusterserviceversion.yaml
sed -i "s#containerImage: quay.io/pulp/pulp-operator:devel#containerImage: quay.io/pulp/pulp-operator:v${PULP_OPERATOR_RELEASE_VERSION}#g" $CSV_FILE
echo " replaces: pulp-operator.v${PULP_OPERATOR_REPLACE_VERSION}" >> $CSV_FILE

ANNOTATIONS_FILE=${CATALOG_DIR}/metadata/annotations.yaml
echo 'com.redhat.openshift.versions: "v4.17-v4.18"' >> $ANNOTATIONS_FILE
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #1573 to improve this situation.


echo "Commiting changes ..."
git add operators/pulp-operator/
git commit -sm "operator pulp-operator ($PULP_OPERATOR_RELEASE_VERSION)"
Expand All @@ -86,4 +89,4 @@ bump_version
operatorhub
redhat_catalog

echo -e "[\e[32mOK\e[0m] All tasks finished!"
echo -e "[\e[32mOK\e[0m] All tasks finished!"
Loading