mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
Remove OperatorHub automation and documentation (#2101)
AWX Operator is no longer published to OperatorHub. Remove the publish-operator-hub GHA workflow, the hack/publish-to-operator-hub.sh script, the OperatorHub section from the release process docs, and the OperatorHub-specific resource list from the debugging guide. Author: Christian M. Adams Assisted By: Claude
This commit is contained in:
86
.github/workflows/publish-operator-hub.yaml
vendored
86
.github/workflows/publish-operator-hub.yaml
vendored
@@ -1,86 +0,0 @@
|
|||||||
name: Publish AWX Operator on operator-hub
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
tag_name:
|
|
||||||
description: 'Name for the tag of the release.'
|
|
||||||
required: true
|
|
||||||
operator_hub_fork:
|
|
||||||
description: 'Fork of operator-hub where the PR will be created from. default: awx-auto'
|
|
||||||
required: true
|
|
||||||
default: 'awx-auto'
|
|
||||||
image_registry:
|
|
||||||
description: 'Image registry where the image is published to. default: quay.io'
|
|
||||||
required: true
|
|
||||||
default: 'quay.io'
|
|
||||||
image_registry_organization:
|
|
||||||
description: 'Image registry organization where the image is published to. default: ansible'
|
|
||||||
required: true
|
|
||||||
default: 'ansible'
|
|
||||||
community_operator_github_org:
|
|
||||||
description: 'Github organization for community-opeartor project. default: k8s-operatorhub'
|
|
||||||
required: true
|
|
||||||
default: 'k8s-operatorhub'
|
|
||||||
community_operator_prod_github_org:
|
|
||||||
description: 'GitHub organization for community-operator-prod project. default: redhat-openshift-ecosystem'
|
|
||||||
required: true
|
|
||||||
default: 'redhat-openshift-ecosystem'
|
|
||||||
jobs:
|
|
||||||
promote:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Set GITHUB_ENV from workflow_dispatch event
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
run: |
|
|
||||||
echo "VERSION=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
|
||||||
echo "IMAGE_REGISTRY=${{ github.event.inputs.image_registry }}" >> $GITHUB_ENV
|
|
||||||
echo "IMAGE_REGISTRY_ORGANIZATION=${{ github.event.inputs.image_registry_organization }}" >> $GITHUB_ENV
|
|
||||||
echo "COMMUNITY_OPERATOR_GITHUB_ORG=${{ github.event.inputs.community_operator_github_org }}" >> $GITHUB_ENV
|
|
||||||
echo "COMMUNITY_OPERATOR_PROD_GITHUB_ORG=${{ github.event.inputs.community_operator_prod_github_org }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Set GITHUB_ENV for release event
|
|
||||||
if: ${{ github.event_name == 'release' }}
|
|
||||||
run: |
|
|
||||||
echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
|
|
||||||
echo "IMAGE_REGISTRY=quay.io" >> $GITHUB_ENV
|
|
||||||
echo "IMAGE_REGISTRY_ORGANIZATION=ansible" >> $GITHUB_ENV
|
|
||||||
echo "COMMUNITY_OPERATOR_GITHUB_ORG=k8s-operatorhub" >> $GITHUB_ENV
|
|
||||||
echo "COMMUNITY_OPERATOR_PROD_GITHUB_ORG=redhat-openshift-ecosystem" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Log in to image registry
|
|
||||||
run: |
|
|
||||||
echo ${{ secrets.QUAY_TOKEN }} | docker login ${{ env.IMAGE_REGISTRY }} -u ${{ secrets.QUAY_USER }} --password-stdin
|
|
||||||
|
|
||||||
- name: Checkout awx-operator at workflow branch
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
path: awx-operator
|
|
||||||
|
|
||||||
- name: Checkout awx-opearator at ${{ env.VERSION }}
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-tags: true
|
|
||||||
ref: ${{ env.VERSION }}
|
|
||||||
path: awx-operator-${{ env.VERSION }}
|
|
||||||
fetch-depth: 0 # fetch all history so that git describe works
|
|
||||||
|
|
||||||
- name: Copy scripts to awx-operator-${{ env.VERSION }}
|
|
||||||
run: |
|
|
||||||
cp -f \
|
|
||||||
awx-operator/hack/publish-to-operator-hub.sh \
|
|
||||||
awx-operator-${{ env.VERSION }}/hack/publish-to-operator-hub.sh
|
|
||||||
cp -f \
|
|
||||||
awx-operator/Makefile \
|
|
||||||
awx-operator-${{ env.VERSION }}/Makefile
|
|
||||||
|
|
||||||
- name: Build and publish bundle to operator-hub
|
|
||||||
working-directory: awx-operator-${{ env.VERSION }}
|
|
||||||
env:
|
|
||||||
IMG_REPOSITORY: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REGISTRY_ORGANIZATION }}
|
|
||||||
GITHUB_TOKEN: ${{ secrets.AWX_AUTO_GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
git config --global user.email "awx-automation@redhat.com"
|
|
||||||
git config --global user.name "AWX Automation"
|
|
||||||
./hack/publish-to-operator-hub.sh
|
|
||||||
@@ -8,20 +8,3 @@ After the draft release is created, publish it and the [Promote AWX Operator ima
|
|||||||
|
|
||||||
- Publish image to Quay
|
- Publish image to Quay
|
||||||
- Release Helm chart
|
- Release Helm chart
|
||||||
|
|
||||||
After the GHA is complete, the final step is to run the [publish-to-operator-hub.sh](https://github.com/ansible/awx-operator/blob/devel/hack/publish-to-operator-hub.sh) script, which will create a PR in the following repos to add the new awx-operator bundle version to OperatorHub:
|
|
||||||
|
|
||||||
- <https://github.com/k8s-operatorhub/community-operators> (community operator index)
|
|
||||||
- <https://github.com/redhat-openshift-ecosystem/community-operators-prod> (operator index shipped with Openshift)
|
|
||||||
|
|
||||||
!!! note
|
|
||||||
The usage is documented in the script itself, but here is an example of how you would use the script to publish the 2.5.3 awx-opeator bundle to OperatorHub.
|
|
||||||
Note that you need to specify the version being released, as well as the previous version. This is because the bundle has a pointer to the previous version that is it being upgrade from. This is used by OLM to create a dependency graph.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
VERSION=2.5.3 PREV_VERSION=2.5.2 ./hack/publish-to-operator-hub.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
There are some quirks with running this on OS X that still need to be fixed, but the script runs smoothly on linux.
|
|
||||||
|
|
||||||
As soon as CI completes successfully, the PR's will be auto-merged. Please remember to monitor those PR's to make sure that CI passes, sometimes it needs a retry.
|
|
||||||
|
|||||||
@@ -24,13 +24,6 @@ Past that, it is often useful to inspect various resources the AWX Operator mana
|
|||||||
* secrets
|
* secrets
|
||||||
* serviceaccount
|
* serviceaccount
|
||||||
|
|
||||||
And if installing via OperatorHub and OLM:
|
|
||||||
|
|
||||||
* subscription
|
|
||||||
* csv
|
|
||||||
* installPlan
|
|
||||||
* catalogSource
|
|
||||||
|
|
||||||
To inspect these resources you can use these commands
|
To inspect these resources you can use these commands
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|||||||
@@ -1,123 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Create PR to Publish to community-operators and community-operators-prod
|
|
||||||
#
|
|
||||||
# * Create upstream awx-operator release
|
|
||||||
# * Check out tag (1.1.2).
|
|
||||||
# * Run VERSION=1.1.2 make bundle
|
|
||||||
# * Clone https://github.com/k8s-operatorhub/community-operators --branch main
|
|
||||||
# * mkdir -p operators/awx-operator/0.31.0/
|
|
||||||
# * Copy in manifests/ metadata/ and tests/ directories into operators/awx-operator/1.1.2/
|
|
||||||
# * Use sed to add in a replaces or skip entry. replace by default.
|
|
||||||
# * No need to update config.yaml
|
|
||||||
# * Build and Push operator and bundle images
|
|
||||||
# * Open PR or at least push to a branch so that a PR can be manually opened from it.
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# First, check out awx-operator tag you intend to release, in this case, 1.0.0
|
|
||||||
# $ VERSION=1.1.2 PREV_VERSION=1.1.1 FORK=<your-fork> ./hack/publish-to-operator-hub.sh
|
|
||||||
#
|
|
||||||
# Remember to change update the VERSION and PREV_VERSION before running!!!
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
VERSION=${VERSION:-$(make print-VERSION)}
|
|
||||||
PREV_VERSION=${PREV_VERSION:-$(make print-PREV_VERSION)}
|
|
||||||
|
|
||||||
BRANCH=publish-awx-operator-$VERSION
|
|
||||||
FORK=${FORK:-awx-auto}
|
|
||||||
GITHUB_TOKEN=${GITHUB_TOKEN:-$AWX_AUTO_GITHUB_TOKEN}
|
|
||||||
|
|
||||||
IMG_REPOSITORY=${IMG_REPOSITORY:-quay.io/ansible}
|
|
||||||
|
|
||||||
OPERATOR_IMG=$IMG_REPOSITORY/awx-operator:$VERSION
|
|
||||||
CATALOG_IMG=$IMG_REPOSITORY/awx-operator-catalog:$VERSION
|
|
||||||
BUNDLE_IMG=$IMG_REPOSITORY/awx-operator-bundle:$VERSION
|
|
||||||
|
|
||||||
COMMUNITY_OPERATOR_GITHUB_ORG=${COMMUNITY_OPERATOR_GITHUB_ORG:-k8s-operatorhub}
|
|
||||||
COMMUNITY_OPERATOR_PROD_GITHUB_ORG=${COMMUNITY_OPERATOR_PROD_GITHUB_ORG:-redhat-openshift-ecosystem}
|
|
||||||
|
|
||||||
# Build bundle directory
|
|
||||||
make bundle IMG=$OPERATOR_IMG
|
|
||||||
|
|
||||||
# Build bundle and catalog images
|
|
||||||
make bundle-build bundle-push BUNDLE_IMG=$BUNDLE_IMG IMG=$OPERATOR_IMG
|
|
||||||
make catalog-build catalog-push CATALOG_IMG=$CATALOG_IMG BUNDLE_IMGS=$BUNDLE_IMG BUNDLE_IMG=$BUNDLE_IMG IMG=$OPERATOR_IMG
|
|
||||||
|
|
||||||
# Set containerImage & namespace variables in CSV
|
|
||||||
sed -i.bak -e "s|containerImage: quay.io/ansible/awx-operator:devel|containerImage: ${OPERATOR_IMG}|g" bundle/manifests/awx-operator.clusterserviceversion.yaml
|
|
||||||
sed -i.bak -e "s|namespace: placeholder|namespace: awx|g" bundle/manifests/awx-operator.clusterserviceversion.yaml
|
|
||||||
|
|
||||||
# Add replaces to dependency graph for upgrade path
|
|
||||||
if ! grep -qF 'replaces: awx-operator.v${PREV_VERSION}' bundle/manifests/awx-operator.clusterserviceversion.yaml; then
|
|
||||||
sed -i.bak -e "/version: ${VERSION}/a \\
|
|
||||||
replaces: awx-operator.v$PREV_VERSION" bundle/manifests/awx-operator.clusterserviceversion.yaml
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Rename CSV to contain version in name
|
|
||||||
mv bundle/manifests/awx-operator.clusterserviceversion.yaml bundle/manifests/awx-operator.v${VERSION}.clusterserviceversion.yaml
|
|
||||||
|
|
||||||
# Set Openshift Support Range (bump minKubeVersion in CSV when changing)
|
|
||||||
if ! grep -qF 'openshift.versions' bundle/metadata/annotations.yaml; then
|
|
||||||
sed -i.bak -e "/annotations:/a \\
|
|
||||||
com.redhat.openshift.versions: v4.11" bundle/metadata/annotations.yaml
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove .bak files from bundle result from sed commands
|
|
||||||
find bundle -name "*.bak" -type f -delete
|
|
||||||
|
|
||||||
echo "-- Create branch on community-operators fork --"
|
|
||||||
git clone https://github.com/$COMMUNITY_OPERATOR_GITHUB_ORG/community-operators.git
|
|
||||||
|
|
||||||
mkdir -p community-operators/operators/awx-operator/$VERSION/
|
|
||||||
cp -r bundle/* community-operators/operators/awx-operator/$VERSION/
|
|
||||||
pushd community-operators/operators/awx-operator/$VERSION/
|
|
||||||
|
|
||||||
git checkout -b $BRANCH
|
|
||||||
git add ./
|
|
||||||
git status
|
|
||||||
|
|
||||||
message='operator [N] [CI] awx-operator'
|
|
||||||
commitMessage="${message} ${VERSION}"
|
|
||||||
git commit -m "$commitMessage" -s
|
|
||||||
|
|
||||||
git remote add upstream https://$GITHUB_TOKEN@github.com/$FORK/community-operators.git
|
|
||||||
|
|
||||||
git push upstream --delete $BRANCH || true
|
|
||||||
git push upstream $BRANCH
|
|
||||||
|
|
||||||
gh pr create \
|
|
||||||
--title "operator awx-operator (${VERSION})" \
|
|
||||||
--body "operator awx-operator (${VERSION})" \
|
|
||||||
--base main \
|
|
||||||
--head $FORK:$BRANCH \
|
|
||||||
--repo $COMMUNITY_OPERATOR_GITHUB_ORG/community-operators
|
|
||||||
popd
|
|
||||||
|
|
||||||
echo "-- Create branch on community-operators-prod fork --"
|
|
||||||
git clone https://github.com/$COMMUNITY_OPERATOR_PROD_GITHUB_ORG/community-operators-prod.git
|
|
||||||
|
|
||||||
mkdir -p community-operators-prod/operators/awx-operator/$VERSION/
|
|
||||||
cp -r bundle/* community-operators-prod/operators/awx-operator/$VERSION/
|
|
||||||
pushd community-operators-prod/operators/awx-operator/$VERSION/
|
|
||||||
|
|
||||||
git checkout -b $BRANCH
|
|
||||||
git add ./
|
|
||||||
git status
|
|
||||||
|
|
||||||
message='operator [N] [CI] awx-operator'
|
|
||||||
commitMessage="${message} ${VERSION}"
|
|
||||||
git commit -m "$commitMessage" -s
|
|
||||||
|
|
||||||
git remote add upstream https://$GITHUB_TOKEN@github.com/$FORK/community-operators-prod.git
|
|
||||||
|
|
||||||
git push upstream --delete $BRANCH || true
|
|
||||||
git push upstream $BRANCH
|
|
||||||
|
|
||||||
gh pr create \
|
|
||||||
--title "operator awx-operator (${VERSION})" \
|
|
||||||
--body "operator awx-operator (${VERSION})" \
|
|
||||||
--base main \
|
|
||||||
--head $FORK:$BRANCH \
|
|
||||||
--repo $COMMUNITY_OPERATOR_PROD_GITHUB_ORG/community-operators-prod
|
|
||||||
popd
|
|
||||||
Reference in New Issue
Block a user