Red Hat Konflux update network-observability-operator-fbc-1-7-416 #2842
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and push PR image to quay.io | |
on: | |
pull_request_target: | |
types: [labeled] | |
env: | |
WF_REGISTRY_USER: netobserv+github_ci | |
WF_REGISTRY: quay.io/netobserv | |
WF_IMAGE: network-observability-operator | |
WF_ORG: netobserv | |
WF_RELIMG_VERSION: main | |
jobs: | |
push-pr-image: | |
if: ${{ github.event.label.name == 'ok-to-test' }} | |
name: push PR image | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: ['1.22'] | |
steps: | |
- name: install make | |
run: sudo apt-get install make | |
- name: set up go 1.x | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: "refs/pull/${{ github.event.number }}/merge" | |
- name: docker login to quay.io | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ env.WF_REGISTRY_USER }} | |
password: ${{ secrets.QUAY_SECRET }} | |
registry: quay.io | |
- name: get short sha | |
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: build image | |
run: OCI_BUILD_OPTS="--label quay.expires-after=2w" IMAGE_ORG=${{ env.WF_ORG }} IMAGE=${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}:${{ env.short_sha }} make image-build | |
- name: push image | |
run: IMAGE_ORG=${{ env.WF_ORG }} IMAGE=${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}:${{ env.short_sha }} make image-push | |
- name: build and push manifest | |
run: IMAGE_ORG=${{ env.WF_ORG }} IMAGE=${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}:${{ env.short_sha }} make manifest-build manifest-push | |
- name: get related images target | |
if: startsWith(github.ref_name, 'release-') | |
run: | | |
echo "WF_RELIMG_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | |
- name: build bundle | |
run: OCI_BUILD_OPTS="--label quay.expires-after=2w" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.short_sha }} PLG_VERSION=${{ env.WF_RELIMG_VERSION }} FLP_VERSION=${{ env.WF_RELIMG_VERSION }} BPF_VERSION=${{ env.WF_RELIMG_VERSION }} BUNDLE_VERSION=0.0.0-${{ env.short_sha }} make bundle bundle-build | |
- name: push bundle to quay.io | |
run: IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.short_sha }} BUNDLE_VERSION=0.0.0-${{ env.short_sha }} make bundle-push | |
- name: build catalog | |
run: IMAGE_ORG=${{ env.WF_ORG }} BUNDLE_VERSION=0.0.0-${{ env.short_sha }} make shortlived-catalog-build | |
- name: push catalog to quay.io | |
run: IMAGE_ORG=${{ env.WF_ORG }} BUNDLE_VERSION=0.0.0-${{ env.short_sha }} make catalog-push | |
- uses: actions/github-script@v5 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `New images: | |
* ${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}:${{ env.short_sha }} | |
* ${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}-bundle:v0.0.0-${{ env.short_sha }} | |
* ${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}-catalog:v0.0.0-${{ env.short_sha }} | |
They will expire after two weeks. | |
To deploy this build: | |
\`\`\`bash | |
# Direct deployment, from operator repo | |
IMAGE=${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}:${{ env.short_sha }} make deploy | |
# Or using operator-sdk | |
operator-sdk run bundle ${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}-bundle:v0.0.0-${{ env.short_sha }} | |
\`\`\` | |
Or as a Catalog Source: | |
\`\`\`yaml | |
apiVersion: operators.coreos.com/v1alpha1 | |
kind: CatalogSource | |
metadata: | |
name: netobserv-dev | |
namespace: openshift-marketplace | |
spec: | |
sourceType: grpc | |
image: ${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}-catalog:v0.0.0-${{ env.short_sha }} | |
displayName: NetObserv development catalog | |
publisher: Me | |
updateStrategy: | |
registryPoll: | |
interval: 1m | |
\`\`\` | |
` | |
}) |