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

.konflux: rework how we manage indexes… #797

Merged
merged 1 commit into from
Nov 28, 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
66 changes: 66 additions & 0 deletions .github/workflows/index-render-template-main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: index-render-template-main

on:
workflow_dispatch: {}
pull_request:
paths:
- .konflux/olm-catalog/index/**
push:
paths:
paths:
- .konflux/olm-catalog/index/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-matrix:
runs-on: ubuntu-latest
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- id: set-matrix
run: |
echo "versions=$(cd .konflux/olm-catalog/index && ls -d v*)" >> $GITHUB_OUTPUT
outputs:
versions: ${{ steps.set-matrix.outputs.projects }}
generate-catalog:
needs: build-matrix
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.build-matrix.outputs.version) }}
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Generate ${{matrix.version}} catalog
run: |
echo ${{matrix.version}}
curl -sSfLo /usr/local/bin/opm "https://github.com/operator-framework/operator-registry/releases/download/v1.47.0/linux-amd64-opm"
chmod +x /usr/local/bin/opm
opm alpha render-template basic .konflux/olm-catalog/index/${{matrix.version}}/catalog-template.json > .konflux/olm-catalog/index/${{matrix.version}}/catalog/openshift-pipelines-operator-rh/catalog.json
- name: Commit new changes
run: |
git config user.name openshift-pipelines-bot
git config user.email [email protected]
git checkout -b actions/index/${{matrix.version}}

git add .konflux/olm-catalog/index/${{matrix.version}}/catalog
git commit -F- <<EOF
[bot:main] Update ${{matrix.version}} generate catalog
EOF

git push -f origin actions/index/${{matrix.version}}
if [ "$(gh pr list --base main --head actions/index/${{matrix.version}} --json url --jq 'length')" = "0" ]; then
echo "creating PR..."
gh pr create -B main -H actions/index/${{matrix.version}} --label=automated --fill
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ kind: Component
metadata:
annotations:
build.appstudio.openshift.io/pipeline: '{"name":"fbc-builder","bundle":"latest"}'
name: operator-main-index
name: operator-main-index-4-15
spec:
componentName: operator-main-index
componentName: operator-main-index-4-15
application: operator-main
source:
git:
url: https://github.com/openshift-pipelines/operator.git
dockerfileUrl: .konflux/olm-catalog/openshift-pipelines/index/Dockerfile
dockerfileUrl: .konflux/olm-catalog/openshift-pipelines/index/v4-15/Dockerfile.catalog
revision: main
15 changes: 15 additions & 0 deletions .konflux/main/component-index-4.16.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
annotations:
build.appstudio.openshift.io/pipeline: '{"name":"fbc-builder","bundle":"latest"}'
name: operator-main-index-4-16
spec:
componentName: operator-main-index-4-16
application: operator-main
source:
git:
url: https://github.com/openshift-pipelines/operator.git
dockerfileUrl: .konflux/olm-catalog/openshift-pipelines/index/v4.16/Dockerfile.catalog
revision: main
15 changes: 15 additions & 0 deletions .konflux/main/component-index-4.17.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
annotations:
build.appstudio.openshift.io/pipeline: '{"name":"fbc-builder","bundle":"latest"}'
name: operator-main-index-4-17
spec:
componentName: operator-main-index-4-17
application: operator-main
source:
git:
url: https://github.com/openshift-pipelines/operator.git
dockerfileUrl: .konflux/olm-catalog/openshift-pipelines/index/v4.17/Dockerfile.catalog
revision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ metadata:
appstudio.redhat.com/application: operator-main
spec:
image:
name: operator-main/index
name: operator-main/index-4.15
visibility: public
14 changes: 14 additions & 0 deletions .konflux/main/image-index-4.16.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: ImageRepository
metadata:
name: operator-main-index
annotations:
image-controller.appstudio.redhat.com/update-component-image: "true"
labels:
appstudio.redhat.com/component: operator-main-index
appstudio.redhat.com/application: operator-main
spec:
image:
name: operator-main/index-4.16
visibility: public
14 changes: 14 additions & 0 deletions .konflux/main/image-index-4.17.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: ImageRepository
metadata:
name: operator-main-index
annotations:
image-controller.appstudio.redhat.com/update-component-image: "true"
labels:
appstudio.redhat.com/component: operator-main-index
appstudio.redhat.com/application: operator-main
spec:
image:
name: operator-main/index-4.17
visibility: public
6 changes: 3 additions & 3 deletions .konflux/olm-catalog/bundle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ COPY .konflux/olm-catalog/bundle/metadata/annotations.yaml /metadata/annotations
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=serverless-operator
LABEL operators.operatorframework.io.bundle.channel.default.v1="latest"
LABEL operators.operatorframework.io.bundle.channels.v1="latest,pipelines-5.0"
LABEL operators.operatorframework.io.bundle.package.v1=openshift-pipelines-operator-rh
LABEL operators.operatorframework.io.bundle.channel.default.v1="pipelines-main"
LABEL operators.operatorframework.io.bundle.channels.v1="pipelines-main"

LABEL \
com.redhat.component="openshift-pipelines-operator-bundle-container" \
Expand Down
Loading