Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate Communities bundle creation #131

Merged
merged 3 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
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
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release bundles
on:
workflow_dispatch:
inputs:
version:
description: "The version to release, without the leading `v`"
required: true
type: string
previous_version:
description: "The previous version, used for the CVS's `replaces` field, without the leading `v`"
required: true
type: string
community:
description: "The community to release the bundle to"
required: true
type: choice
default: "K8S"
options:
- K8S
- OKD

jobs:
make_k8s_community_bundle:
if: inputs.community == 'K8S'
uses: medik8s/.github/.github/workflows/release_community_bundle_parametric.yaml@main
secrets: inherit
with:
version: ${{ inputs.version }}
previous_version: ${{ inputs.previous_version }}
community: ${{ inputs.community }}
make_targets: "bundle-community-k8s"
make_okd_community_bundle:
if: inputs.community == 'OKD'
uses: medik8s/.github/.github/workflows/release_community_bundle_parametric.yaml@main
secrets: inherit
with:
version: ${{ inputs.version }}
previous_version: ${{ inputs.previous_version }}
community: ${{ inputs.community }}
make_targets: "bundle-community-rh"
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ OPERATOR_SDK_VERSION ?= v1.32.0
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.28

# OCP Version: for OKD bundle community
OCP_VERSION = 4.12

# IMAGE_REGISTRY used to indicate the registery/group for the operator, bundle and catalog
IMAGE_REGISTRY ?= quay.io/medik8s
export IMAGE_REGISTRY
Expand Down Expand Up @@ -268,6 +271,13 @@ verify-previous-version: ## Verifies that PREVIOUS_VERSION variable is set
bundle-reset-date: ## Reset bundle's createdAt
sed -r -i "s|createdAt: .*|createdAt: \"\"|;" ${BUNDLE_CSV}

.PHONY: bundle-community-k8s
bundle-community-k8s: bundle-community ## Generate bundle manifests and metadata customized to Red Hat community release

.PHONY: bundle-community-rh
bundle-community-rh: bundle-community ## Generate bundle manifests and metadata customized to Red Hat community release
echo -e "\n # Annotations for OCP\n com.redhat.openshift.versions: \"v${OCP_VERSION}\"" >> bundle/metadata/annotations.yaml

Copy link
Member

@razo7 razo7 Feb 28, 2024

Choose a reason for hiding this comment

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

Add $(MAKE) bundle-update at the end as in bundle-community target?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why do it twice?

Copy link
Member

Choose a reason for hiding this comment

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

You are right. I haven't noticed that bundle-community-rh already calls bundle-community...

.PHONY: bundle-community
bundle-community: bundle ## Update displayName field in the bundle's CSV
sed -r -i "s|displayName: Fence Agents Remediation Operator|displayName: Fence Agents Remediation Operator - Community Edition|;" ${BUNDLE_CSV}
Expand Down
Loading